skip to Main Content

Html – actually i am unable to fetch the data from an Array[Object{}]. Especially unable to iterate individually using for loop

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:…

VIEW QUESTION

Html – Cant solve type error. Probably a basic question but getting no where with what seems to be a very simple piece of code

code: const generateResponse = async (incomingChatLi) => { const API_URL = "https://api.openai.com/v1/chat/completions"; const pElement = document.createElement("p"); // fetch response from openai api & define properties requestOptions = { method: 'POST', headers: { "Content-Type": "application/json", "Authorization": `Bearer ${API_KEY}` }, body: JSON.stringify({…

VIEW QUESTION
Back To Top
Search