Skip to content

Instantly share code, notes, and snippets.

@Vchouliaras
Forked from gladchinda/type.js
Created September 29, 2018 08:23
Show Gist options
  • Save Vchouliaras/969189b32278c04346a6bc87fcd7c069 to your computer and use it in GitHub Desktop.
Save Vchouliaras/969189b32278c04346a6bc87fcd7c069 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