JavaScript join() 步骤

JavaScript join() 方法This will put span tags around all the words in you paragraphs, turning1./*2.

JavaScript join() 方法

 


This will put span tags around all the words in you paragraphs, turning




1./*  2.JScript does not default the separator to “,” if the separator value is undefined.  3.*/  4.    var array = [1, 2];   5.    alert(array.join());   6.    alert(array.join(undefined));   7.    alert(array.join('-'));   8./*  9.Output:   10.     IE: 1,2 1undefined2 1-2  11.     FF: 1,2 1,2 1-2   12.  Opera: same as FF   13. Safari: same as FF  14.*/