check if object has key and values are same in javascript code example Example: check if field exists in object javascript if ('field' in obj) { }