back to Overview

.join()

Converts list elements into strings and joins them into a single string, optionally separated with the given separator.
Util module only.

Syntax Variants

list.join()
list.join(separator)

Parameters

separator (optional)
a separator to put between the joined strings. If omitted, the string "," (comma) will be used.
otherList
The other list of values. Can be an array, a Minified list or any other array-like structure with length property.
(return value)
the resulting string

Description

Converts list elements into strings and joins them into a single string, optionally separated with the given separator. This method is identical to Array's built-in join() method and also uses it internally.

Example

Join a few string:

var joined = _('Harry', 'Bert', 'Tom', 'Bo').join(', '); // returns 'Harry, Bert, Tom, Bo'

Comments

comments powered by Disqus

back to Overview

Functions