I\'m running an express.js app that has a few apis feeding data to dropdown boxes. The data returned is in the form:
[ { key: \'blah\',
You could map:
permittedValues = array.map(function(value) { return value.key; });
In ES6/ES2015 it's even prettier with arrow functions:
permittedValues = array.map(value => value.key);
It might be prettier, but it's probably not faster than a for() loop.
for()