js check if object has any property code example
Example 1: array has object with property js
myArray.some(obj => obj.property === 'value')
// returns true or false
Example 2: typescript check if object has key
if ('key' in myObj)
myArray.some(obj => obj.property === 'value')
// returns true or false
if ('key' in myObj)