SOLVED Help find property of objects in array

Im doing some event whit script in mv and i'm having such a problem:
I need a way to issolate the values of a concrete property of all objects inside a new array, i mean
for this array
[
object{
id:1
name:blalba
},
object{
id:34
name:blalba
},
object{
id:6789
name:blalba
}
]
Its only a example, i want to get all the id parameter value of all objects in the array and save it in a new array, and the new array has to look somthing like:
[1, 34, 6789]
 
Here's an example in action.

Code:
// Define array of objects.
var objects = [{
    id: 1,
    name: "blalba"
}, {
    id: 34,
    name: "blalba"
}, {
    id: 6789,
    name: "blalba"
}];

// Pass an anonymous function into the map() method.
// The map() method then calls the function for each element
// of the array. The function returns the value of the object's
// id property. The map() method then returns those id values
// as an array which is assigned to the ids variable.
var ids = objects.map(function (object) {
    return object.id;
});

console.log(ids);
Here's an example in action.



// Define array of objects.
var objects = [{
id: 1,
name: "blalba"
}, {
id: 34,
name: "blalba"
}, {
id: 6789,
name: "blalba"
}];

// Pass an anonymous function into the map() method.
// The map() method then calls the function for each element
// of the array. The function returns the value of the object's
// id property. The map() method then returns those id values
// as an array which is assigned to the ids variable.
var ids = objects.map(function (object) {
return object.id;
});

console.log(ids);

Thank you very much, that works
Glad to help.

Original thread: https://forums.rpgmakerweb.com/threads/solved-help-find-property-of-objects-in-array.63881/