So lets say i have an array like so
[
{name: "a", happyName: "bob" }
, {name: "b", happyName: "cow" }
, {name: "c", happyName: "moo" }
, {name: "d", happyName: "jen" }
]
What is the most efficient manner to flatten it to an array like so:
[ "a","b","c","d"]
(or alternatively to get only the happyName in the values instead - to be precise, i suppose, how would i flatten some given array into an array of some given named json attribute?)
NB this is javascript only, no JQuery etc stuff please.