var result = arrOfObj.map(function(el) {
var o = Object.assign({}, el);
o.isActive = true;
return o;
});
const devices = [{scenarioId: 'a', key: 'value}, {scenarioId: 'b', key: 'value'}]
// exepected output
// ids = ['a', 'b']
const ids = devices.map((device) => device.scenarioId);
// eleminate id===null
const ids = devices.map(device => device.scenarioId).filter(id => id !== null);