how to check if a field is present in an object javascript code example Example: check if field exists in object javascript if ('field' in obj) { }