Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

condition if variable is string javascript

if (typeof a_string === 'string') {
    // this is a string
}

if (typeof myVar === 'integer'){
    //I am indeed an integer
}

if (typeof myVar === 'boolean'){
    //I am indeed a boolean
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #condition #variable #string #javascript
ADD COMMENT
Topic
Name
5+9 =