Published
- 1 min read
display true if the parameter is type string
The solution for this is noted below
display true if the parameter is type string
Solution
if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else
Try other methods by searching on the site. That is if this doesn’t work