Answers for "javascript if not string then convert 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 "javascript if not string then convert string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language