complete-javascript-course icon indicating copy to clipboard operation
complete-javascript-course copied to clipboard

Out first AJAX call doesn't work anymore ! Managed to fix it if you need help.

Open jbednar97 opened this issue 3 years ago • 1 comments

Hello, in the part of the video of our first ajax calls, ive ran into trouble getting to display data from the API.

While inserting adjacent HTML, we used data.languages[0].name which didnt work at all for me, same for data.currencies[0].name.

I had to change it to : data.languages[Object.keys(data.languages)[0]]

data.currencies[Object.keys(data.currencies[0]].name

Use Object.keys to fix your problem !

jbednar97 avatar Oct 22 '21 07:10 jbednar97

I thank you! you helped me solve the problem!

ghost avatar Nov 04 '21 09:11 ghost