how to check string or not in javascript object code example
Example 1: if string javascript
if (typeof myVar === 'string') { /* code */ };
Example 2: check data type in javascript
typeof("string"); //string
typeof(123); //number
if (typeof myVar === 'string') { /* code */ };
typeof("string"); //string
typeof(123); //number