Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if variable is set javascript

if(element){
  !isNaN(Number(element)) // check if variable is set and is a number
}

element && !isNaN(Number(element)) ? Number(element) : 0; // for number usage comming from db
 
PREVIOUS NEXT
Tagged: #check #variable #set #javascript
ADD COMMENT
Topic
Name
2+1 =