add property to object javascript using map code example
Example 1: map add key to object in array javascript
const newArr = [
{name: 'eve'},
{name: 'john'},
{name: 'jane'}
].map(v => ({...v, isActive: true}))
Example 2: map object and add new property javascript
Results.map(obj=> ({ ...obj, Active: 'false' }))