Created
October 21, 2018 11:58
-
-
Save ufocoder/7df39101a36b1784b853513e15d134c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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