JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

Array.toString()

Array.toString()


convert an array to a string Overrides Object.toString()

Synopsis

array.toString()

Returns

A string representation of array.

Throws

TypeError

If this method is invoked on an object that is not an Array.

Description

The toString() method of an array converts an array to a string and returns the string. When an array is used in a string context, JavaScript automatically converts it to a string by calling this method. On some occasions, however, you may want to call toString() explicitly.

toString() converts an array to a string by first converting each array element to strings (by calling its toString()method). Once each element is converted to a string, toString()outputs them in a comma-separated list. This return value is the same string that would be returned by the join() method with no arguments.

See Also

Array.toLocaleString() , Object.toString()

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/28145.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1