Back

Web APIs / Fetch Resource

00:00
1/20

Fetch Resource

Medium

Write an async function fetchData(url) that fetches data from the URL and returns the parsed JSON object.

  • 1

    Use the fetch API.

  • 2

    Await the response.

  • 3

    Call and await .json().

JAVASCRIPT PLAYGROUND
JAVASCRIPT PLAYGROUND
⏳ Loading editor…