how to check if string in nodejs 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]"
}