Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created September 19, 2018 11:14
Show Gist options
  • Save gladchinda/89abd8eece096b486f946709167ad813 to your computer and use it in GitHub Desktop.
Save gladchinda/89abd8eece096b486f946709167ad813 to your computer and use it in GitHub Desktop.
function type(value) {
var regex = /^\[object (\S+?)\]$/;
var matches = Object.prototype.toString.call(value).match(regex) || [];
return (matches[1] || 'undefined').toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment