Answers for "how to check if value is a string"

16

if string javascript

if (typeof myVar === 'string') { /* code */ };
Posted by: Guest on July-23-2020
0

display true if the parameter is type string

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 "how to check if value is a string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language