JavaScript - Arrays - join
// JavaScript - Array.prototype.join()
arr.join()
arr.join(separator)
separator: Specifies a string to separate each element of the array. The
separator is converted to a string if necessary. If omitted, the array
elements are separated with a comma. If separator is an empty string, all
elements are joined without any characters in between them. Defaults to ",".
The join method returns a string with all the elements joined together by the
separator.
var a = ['Wind', 'Rain', 'Fire'];
a.join(); // 'Wind,Rain,Fire'
a.join('-'); // 'Wind-Rain-Fire'
page revision: 1, last edited: 14 Nov 2016 20:24





