Answers for "javascript check if type is string"

13

javascript is variable a string

if (typeof myVar === 'string'){
    //I am indeed a string
}
Posted by: Guest on July-23-2019
0

check type string javascript

if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else
Posted by: Guest on October-15-2020
0

js check if variable is string </d

if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else
Posted by: Guest on October-15-2020

Code answers related to "javascript check if type is string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language