typescript "is a string" code example
Example: display true if the parameter is type string
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