Skip to content

Instantly share code, notes, and snippets.

@jessebeach
Created January 27, 2016 19:38
Show Gist options
  • Save jessebeach/483c9046fb82c61f4778 to your computer and use it in GitHub Desktop.
Save jessebeach/483c9046fb82c61f4778 to your computer and use it in GitHub Desktop.
typeTagOf
const typeTagOf = (value) => Object.prototype.toString.call(value).slice(8, -1);
console.log(typeTagOf({})); // 'Object'
console.log(typeTagOf([])); // 'Array'
console.log(typeTagOf(function () {})); // 'Function'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment