function to check for string type in js code example
Example: check type string javascript
if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else
if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else