join

  • function
can.List.prototype.join  

Join a List's elements into a string.

list.join(separator)

join turns a List into a string by inserting separator between the string representations of all the elements of the List.

Parameters

  1. separator {String}

    the string to seperate elements with

Returns

{String}

the joined string

var list = new can.List(['Alice', 'Bob', 'Eve']);
list.join(', '); // 'Alice, Bob, Eve'

var beatles = new can.List(['John', 'Paul', 'Ringo', 'George']);
beatles.join('&'); // 'John&Paul&Ringo&George'