How do I check if a particular key exists in a JavaScript object or array?
If a key doesn\'t exist, and I try to access it, will it return false? Or throw an error?<
yourArray.indexOf(yourArrayKeyName) > -1
fruit = ['apple', 'grapes', 'banana'] fruit.indexOf('apple') > -1
true
fruit = ['apple', 'grapes', 'banana'] fruit.indexOf('apple1') > -1
false