Add property to an array of objects
With ES6 you can simply do:
for(const element of Results) {
element.Active = "false";
}
Use Array.prototype.map()
Results.map(obj => ({ ...obj, Active: 'false' }))
Read the documentation for more information.
You can use the forEach
method to execute a provided function once for each element in the array. In this provided function you can add the Active
property to the element.
Results.forEach(function (element) {
element.Active = "false";
});