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 www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #check #property #exists #javascript
ADD COMMENT
Topic
Name
3+9 =