
So my question how can I check this array of objects by "key" for eg I want to check if the key 3892 is there, I have tried with indexOf but no luck, I can't use a loop.
You can use some() and hasOwnProperty()
var array = [{3892: 'value'}, {1234: 'value'}];
var check = array.some(obj => obj.hasOwnProperty(3892));
console.log(check)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With