Javascript Data Type Checker Is String

Description

Javascript Data Type Checker Is String



// Checks to see if something is a string
Object.isString = function(obj) {
    return (typeof obj == 'string')
}

let a = "java2s.com";

console.log(Object.isString(a));/*from ww w  .  j  a  va2 s.  c  om*/



PreviousNext

Related