I have a javascript object array:
array = [ {x:'x1', y:'y1'}, {x:'x2', y:'y2'}, ... {x:'xn', y:'yn'} ]
I want to create a new array of just the x values:
[ 'x1', 'x2', ..., 'xn' ]
I could do this easily in a for loop...:
var newarray = [];
for (var i = 0; i < array.length; i++){
newarray.push(array[i].x);
}
...but I'm wondering if there's a nice one liner way to do this using jquery or even regular javascript?