Array memiliki objek dengan js properti
myArray.some(obj => obj.property === 'value')
// returns true or false
Captain CompileOnTheFirstTime
myArray.some(obj => obj.property === 'value')
// returns true or false
const data = [{ name: 'dendi', age: 23 }, { name: 'dhani' }]
const result = data.filter((v, i) => {
if (!Object.keys(v).includes('age')) {
Object.defineProperty(v, 'age', {
value: 25,
writeable: true,
enumerable: true
})
}
return v
})