Javascript Array implode(symbol)

Description

Javascript Array implode(symbol)

Array.prototype.implode = function(symbol)
{
    var ans = "";
    /*  w w  w  .  java2 s .  co m*/
     for (i=0;i<this.length;i++)
     {
         ans = ans + this[i] + symbol;
     }
     
    return ans.substring(0 , ans.length-1);
}



PreviousNext

Related