Javascript Array toString(trenner)

Description

Javascript Array toString(trenner)


Array.prototype.toString = function (trenner) {
    var str = "";

    if (typeof(trenner) == "undefined")
    {/*  w ww. j  a  v  a2  s .c o  m*/
        trenner = ",";
    }


    for (var i=0;i<this.length;i++)
    {
        str += this[i];

        if (i<this.length-1)
        {
            str += trenner;
        }
    }

    return str;
};



PreviousNext

Related