Answers for "javascript if field exists"

1

javascript if field exists

const hero = {
  name: 'Batman'
};

hero.hasOwnProperty('name');     // => true
hero.hasOwnProperty('realName'); // => false
Posted by: Guest on November-23-2020
0

check if field exists in object javascript

if ('field' in obj) {
}
Posted by: Guest on December-24-2020

Code answers related to "javascript if field exists"

Code answers related to "Javascript"

Browse Popular Code Answers by Language