js test if string
function isString(value) {
return typeof value === 'string' || value instanceof String;
}
isString(''); // true
isString(1); // false
isString({}); // false
isString([]); // false
isString(new String('teste')) // true
if (typeof string === 'string') { /* code */ };
Also in JavaScript:
- node start is too slow windows 10
- how to remove an object from array in react native
- javascript loop through object array
- creating a 2d array in js
- install node js in manjaro
- find least common multiple javascript
- remove first element of array javascript
- node biology definition
- smtpjs attachment
- jquery fedein background color
- how to add multiple comment in react
- click anchor tag using jquery
- content type json
- pushing element in array in javascript
- how to fill false into array javascript
- event listener on parent not on childjavascript
- beautify json python
- devtools failed to load sourcemap when debugging react native
- react native scrollview
- javascript on url anchor change event
- Enclose in Brackets
- kill all node processes
- change style on click react
- core.js:6228 error typeerror: cannot read property 'height' of undefined