Design comparison
SolutionDesign
Solution retrospective
i would appreciate feedback on where i can improve the code and refactor it
Community feedback
- @fazzaamiarsoPosted over 2 years ago
Hello Ebube! Nice work!
I have a quick improvements you can make.
function request(parameter) { const BASE_URL = `https://geo.ipify.org/api/v2/country,city?apiKey=${API_KEY}; const params = parameter ? `&${parameter.name}=${parameter.value}` : ' '; fetch(`${BASE_URL}${params}`) .then((res) => res.json()) .then((res) => setServerData(res)); }
I hope it helps! Cheers!
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord