contains key javascript object code example
Example 1: js object contain key
if ('key' in myObj)
// better
if (!myObj.hasOwnProperty('key'))
Example 2: javascript if object has key
if('key' in object)
if ('key' in myObj)
// better
if (!myObj.hasOwnProperty('key'))
if('key' in object)