Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if property exists javascript

// the coolest way
const obj = {
 weather: 'Sunny; 
}

if('weather' in obj) {
 // do something 
}

Source by h.daily-dev-tips.com #
 
PREVIOUS NEXT
Tagged: #check #property #exists #javascript
ADD COMMENT
Topic
Name
2+6 =