JavaScript · Exercise 1 of 5Next
Beginner
Fetch a user and show it
USER_URL is a data: URL that answers like a real API with {"name":"Asha Rao","city":"Pune"}.
Fetch it, check res.ok, read the JSON, and put the name in #name and the city in #city.
What Check tests
#nameshowsAsha Rao#cityshowsPune- The data comes from
fetch, not typed in - The code checks
res.ok - No errors
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.