if javascript string code example
Example 1: if string javascript
if (typeof myVar === 'string') { /* code */ };
Example 2: javascript if or
let A = 1;
let B = 0;
if (A == 1 || B == 1){
// some code here
}
Example 3: if is a string javascript
function isString(x) {
return Object.prototype.toString.call(x) === "[object String]"
}