How can I access all values with the same key in an object array? Given the following data:
data = [{first_name: 'Peter', last_name: 'Smith', age: 45},
{first_name: 'John', last_name: 'Miller', age: 21}];
Is there a easy way to get an array containing all first names, like first_names = ['Peter', 'John']
?
I guess I'm asking a very frequently asked question, but I couldn't find a solution anywhere to answer it.