How can i check if a particular key exists in a JavaScript array?
Actually, i am checking for undefinedness for whether a key exists. What if the key exists but the value is actually undefined?
var obj = { key: undefined };
obj["key"] != undefined // false, but the key exists!
Best Answer
With
in
operator.