javascript join 数组变字符串。

var arr = new Array(4);
arr[0] = "a";
arr[1] = "b";
arr[2] = "c";
arr[3] = "abcd";

alert(arr.toString());  //a,b,c,abcd
alert(arr.join('|'));    //a|b|c|abcd

 

var arr1 = arr.conat("sfdsf","sdfsdf");

alert(arr1);

posted @ 2011-11-25 15:27  心有余白  阅读(202)  评论(0编辑  收藏  举报