Created
October 21, 2013 11:53
-
-
Save d4rkr00t/7082646 to your computer and use it in GitHub Desktop.
JavaScript - Module Template
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
MYAPP.utilities.array = (function() { | |
var uobj = MYAPP.utilities.object, | |
ulang = MYAPP.utilities.lang, | |
array_string = "[object Array]", | |
ops = Object.prototype.toString; | |
return { | |
inArray: function(needle, haystack) { | |
for (var i = 0, max = haystack.length; i < max; i += 1) { | |
if (haystack[i] === needle) { | |
return true; | |
} | |
} | |
}, | |
isArray: function(a) { | |
return ops.call(a) === array_string; | |
} | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment