Answers for "if how to check if the argument is string in javascript"

5

js test if string

if (typeof string === 'string') { /* code */ };
Posted by: Guest on April-18-2020
6

js check if variable is string

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

if (typeof myVar === 'boolean'){
    //I am indeed a boolean
}
Posted by: Guest on March-19-2020

Code answers related to "if how to check if the argument is string in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language