Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

test if property exists javascript

const hero = {
  name: 'Batman'
};

hero.hasOwnProperty('name');     // => true
hero.hasOwnProperty('realName'); // => false
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #test #property #exists #javascript
ADD COMMENT
Topic
Name
8+7 =