Skip to content

Instantly share code, notes, and snippets.

@Yipee-ki-yay
Created March 3, 2019 11:02
Show Gist options
  • Save Yipee-ki-yay/9ec34a9fc7585e4ae66c9e27421e944e to your computer and use it in GitHub Desktop.
Save Yipee-ki-yay/9ec34a9fc7585e4ae66c9e27421e944e to your computer and use it in GitHub Desktop.
template "open module"
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