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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #property #exists #javascript
ADD COMMENT
Topic
Name
8+1 =