DEV Community

Aneesh
Aneesh

Posted on

Polyfill for a function to check if a value is a string!

var toString = Object.prototype.toString

module.exports = isString

function isString(obj) {
    return toString.call(obj) === "[object String]"
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)