Skip to content

Instantly share code, notes, and snippets.

@Troland
Created July 29, 2020 04:56
Show Gist options
  • Save Troland/723e3df0e88eacf78c2b91a21dd5b150 to your computer and use it in GitHub Desktop.
Save Troland/723e3df0e88eacf78c2b91a21dd5b150 to your computer and use it in GitHub Desktop.
get data type
function getType(obj) {
return Object.prototype.toString.call(obj).replace(/^\[object (.+)\]$/, '$1').toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment