Skip to content

Instantly share code, notes, and snippets.

View kellyjoe256's full-sized avatar

Wafukho Kelly Joseph kellyjoe256

View GitHub Profile
@kellyjoe256
kellyjoe256 / type.js
Last active July 22, 2020 12:03
An alternative way of determining type in JavaScript
function is(value) {
const toString = Object.prototype.toString;
// OR return ({}).toString.call(value).slice(8, -1).toLowerCase();
return toString.call(value).slice(8, -1).toLowerCase();
}