When working with JavaScript, what is the most effective method for extracting all the X values from a multi-dimensional array and storing them in a new array? I am aiming to utilize either reduce or map if feasible. Is there a specific term used to describe this process, akin to a mathematical operation?
[{x:0,y:8,z:-1}, {x:1, y:8.5, z:-0.5}, {x:2, y:9, z:0}]
Additionally, how can this be achieved using the following data structure (preferably) :
[[0,8,-1], [1, 8.5, -0.5], [2, 9, 0]]
My goal is to isolate the x values:
[0,1,2]