Created
November 28, 2014 11:16
-
-
Save kkoziarski/ab79b1bf5ea1a9d321e5 to your computer and use it in GitHub Desktop.
isArray - The Good Parts
This file contains hidden or 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
var isArray = function (value) { | |
return value && | |
typeof value === 'object' && | |
typeof value.length === 'number' && | |
typeof value.splice === 'function' && | |
!(value.propertyIsEnumerable('length')); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment