i want to retrieve certain properties from the array of object and store it in a array.
the data structure looks like below,
object_arr [{…}]0: first_property: "color" id: 25 x: 10 y: 50 z: 56 _proto__: Objectlength: 1__proto__: Array(0) i want to retrieve x, y and z values so the output should be like below
(3) [10, 50, 56] 0: 10 1: 50 2: 56 length: 3 __proto__: Array(0) so final_output[0] should give me 10, final_output[1] should give me 50 and final_output[2] should give 56 what i have tried?
let final_output = object_arr.map(m => { return [ m.x, m.y, m.z ] }); the final_output looks like this,
final_output [Array(3)] 0: (3) [10, 50, 56] length: 1 the expected output is as below, final_output (3) [10, 50, 56] 0: 10 1: 50 2: 56 length: 3 how can i fix this. could someone help me with this. thanks.
final_output = final_output[0]?finalOutput = (({x, y, z}) => [x, y, z])(object_arr[0]).