javascript how to tell if a datatype is string code example
Example 1: js test if string
if (typeof string === 'string') { /* code */ };
Example 2: check data type in javascript
typeof("string"); //string
typeof(123); //number
if (typeof string === 'string') { /* code */ };
typeof("string"); //string
typeof(123); //number