javascript function check value and type code example
Example 1: is string javascript
function isString(value) {
return typeof value === 'string' || value instanceof String;
}
isString(''); // true
isString(1); // false
isString({}); // false
isString([]); // false
isString(new String('teste')) // true
Example 2: check data type in js
typeof("iAmAString");//This should return 'string'
//NO camelCase, as it is a JS Keyword