Skip to content

Instantly share code, notes, and snippets.

@arthurguedes375
Last active December 27, 2021 01:38
Show Gist options
  • Save arthurguedes375/869d5f6e9d176ad198f04b4da83e4067 to your computer and use it in GitHub Desktop.
Save arthurguedes375/869d5f6e9d176ad198f04b4da83e4067 to your computer and use it in GitHub Desktop.
function is(type = '', value) {
const toStringResult = Object.prototype.toString.call(value)
.toLowerCase()
.replace(/[\[\]']/g, "")
.split(" ")[1];
return type === toStringResult;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment