Reputation: 53
I have an array of objects in a JSON format:
[
{
"word": "turkey"
},
{
"word": "tiger"
},
{
"word": "horse"
},
{
"word": "pig"
},
{
"word": "dog"
},
{
"word": "cat"
}
]
I want to extract the value for each "word" key and store it into an array like so:
let wordsArray = ["turkey", "tiger", "horse", "pig", "dog", "cat"];
Upvotes: 1
Views: 49