How to make if statement to check if it's a string javaScirpt code example
Example 1: if string javascript
if (typeof myVar === 'string') { /* code */ };
Example 2: if is a string javascript
function isString(x) {
return Object.prototype.toString.call(x) === "[object String]"
}