Created
May 21, 2015 06:25
-
-
Save wwsun/0762d72d331e675599c6 to your computer and use it in GitHub Desktop.
Methods to check Array, Function, or RegExp
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 isArray(value){ | |
return Object.prototype.toString().call(value) == '[Object Array]'; | |
} | |
function isFunction(value) { | |
return Object.prototype.toString().call(value) == '[Object Function]'; | |
} | |
function isRegExp(value) { | |
return Object.prototype.toString().call(value) == '[Object RegExp]'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment