So I am practicing javascript and I can’t seem to make this work. I am trying to console log a JSON API as an array, but only the title
key:value pair is what I need to display.
This is the expected output I am trying to achieve.
However, this is the output that I’m getting:
Not so sure where I’m wrong, here is my code:
fetch("https://jsonplaceholder.typicode.com/todos")
.then((res) => res.json())
.then((res) => console.log(Array = [res.map((data) => data.title)]));