Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if a key exists in an object javascript

!("key" in obj) // true if "key" doesn't exist in object
!"key" in obj   // ERROR!  Equivalent to "false in obj"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #key #exists #object #javascript
ADD COMMENT
Topic
Name
9+2 =