Fetch API (JavaScript)

const api = "https://95northboutique.store/collections/new-arrivals/products/san-francisco-giants-2000-inaugural-season.json";


fetch(api)
    .then(response => console.log(response.json()))
    .then(data => {
        console.log(data.title)
    })
    .catch(err => console.log("error:" + err))


I'm attempting to call a URL and return data. Running the original console log (response) without the data line returns the promise result object of product. However, when I call data.title, I'm expecting it to return ("SAN FRANCISCO GIANTS 2000 INAUGURAL SEASON"), but it's not able to read these properties as title is undefined?
image.png
image.png
Was this page helpful?