I am new on javascript. What's the best way to extract values of a specific key from list of dictionary without a for loop. For example:
var = [{ name: "Rusty", type: "human", legs: 2, head: 1 },
{ name: "Alex", type: "human", legs: 2, head: 1 },
{ name: "Lassie", type: "dog", legs: 4, head: 1 },
{ name: "Spot", type: "dog", legs: 4, head: 1 },
{ name: "Polly", type: "bird", legs: 2, head: 1 },
{ name: "Fiona", type: "plant", legs: 0, head: 1 }]
I want to extract the values of legs as an array.
var legs = [2,2,4,4,2,0]
Thanks in advance