javascript check if its string code example
Example 1: js test if string
if (typeof string === 'string') { /* code */ };
Example 2: if is a string javascript
function isString(x) {
return Object.prototype.toString.call(x) === "[object String]"
}