Skip to content

Instantly share code, notes, and snippets.

@tshabatyn
Last active July 26, 2017 09:38
Show Gist options
  • Save tshabatyn/8f3a166a6d2a6efad42e835d802162f1 to your computer and use it in GitHub Desktop.
Save tshabatyn/8f3a166a6d2a6efad42e835d802162f1 to your computer and use it in GitHub Desktop.
console.log(Object.prototype.toString.call(undefined)) // [object Undefined]
console.log(Object.prototype.toString.call('undefined')) // [object String]
console.log(Object.prototype.toString.call('')) // [object String]
console.log(Object.prototype.toString.call(4)) // [object Number]
console.log(Object.prototype.toString.call(NaN)) // [object Number]
console.log(Object.prototype.toString.call(true)) // [object Boolean]
console.log(Object.prototype.toString.call({})) // [object Object]
console.log(Object.prototype.toString.call([])) // [object Array]
console.log(Object.prototype.toString.call(function() {})) // [object Function]
console.log(Object.prototype.toString.call(/^[0-9]*$/)) // [object RegExp]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment