Return to Snippet

Revision: 10409
at December 27, 2008 06:58 by aulizko


Updated Code
if (typeof ArrayUtilites == "undefined" || !ArrayUtilites) {
    var ArrayUtilites = {};
}

ArrayUtilites.each = (Array.prototype.forEach) ?
    function (a, f, o) {
        Array.prototype.forEach.call(a, f, o || ArrayUtilites);
        return ArrayUtilites;
    } :
    function (a, f, o) {
        for (var i = 0, it; it = a[i]; i=i+1) {
            f.call(o || ArrayUtilites, it, i, a);
        }
        return ArrayUtilites;
    };

Revision: 10408
at December 27, 2008 06:44 by aulizko


Initial Code
if (typeof ArrayUtilites == "undefined" || !ArrayUtilites) {
    var ArrayUtilites = {};
}

ArrayUtilites.each = (Array.prototype.forEach) ?
    function (a, f, o) {
        Array.prototype.forEach.call(a, f, o || ArrayUtilites);
        return ArrayUtilites;
    } :
    function (a, f, o) {
        for (var i = 0, it; it = a[i]; i=i+1) {
            f.call(o || ArrayUtilites, it, i, a);
        }
        return ArrayUtilites;
    };

Initial URL

                                

Initial Description

                                

Initial Title
Ternar operator used to object-detection

Initial Tags
textmate

Initial Language
JavaScript