i want to extract the data from API individually , how to pull out the data from Array?
let {Array}=jsonData
`fetch("https://apis.ccbp.in/city-bikes?bike_name" + search, options)
.then(function(response){
return response.json();
})
.then(function(jsonData){
let {Array}=jsonData
console.log(Array)
console.log(jsonData)'
})
o/p-undefined
o/p- Array [Object {}]
0: Object {city: "Moscow", id: "velobike-mosco.
2
Answers
If you are getting data based on the query parameters called bike_name, you need to use template literal string for using a variable in the string. Use the arrow functions instead of traditional functions in the then() promise chain. The below code will help you.
Yeah so just loop over it with a for loop?