javascript how to check if something is a string code example
Example 1: javascript is variable a string
if (typeof myVar === 'string'){
//I am indeed a string
}
Example 2: if is a string javascript
function isString(x) {
return Object.prototype.toString.call(x) === "[object String]"
}