Skip to content
Advertisement

How can I fetch a specific array from the JSON data and display it?

Firstly apologies as I am fairly new to fetching from an API and I am trying to learn.

I need to fetch “name” , “age” and “phone” from “id” 1 from “is” and display it when click on button. This is my javascript-fetch-api.js file:

I’m not sure how to fetch only from id 1 “is”

JavaScript
JavaScript

Advertisement

Answer

inside event you have id and language, not name, age and phone. if you want to get name, age and phone from “is”, you should type:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement