Created
March 3, 2019 11:02
-
-
Save morozander/9ec34a9fc7585e4ae66c9e27421e944e to your computer and use it in GitHub Desktop.
template "open module"
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
MYAPP.utilities.array = (function() { | |
// зависимости | |
var uobj = MYAPP.utilities.object, | |
ulang = MYAPP.utilities.lang, | |
// частные свойства | |
array_string = "[object Array]", | |
ops = Object.prototype.toString; | |
// частные методы | |
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; | |
} | |
// конец инструкции var | |
// реализация необязательной процедуры инициализации | |
//.. | |
// общедоступные члены | |
return { | |
// ... другие методы и свойства | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment