Contents

Roo

Array.join()

Returns a new Text object created by converting each element of the array to its text representation, separated by an optional separator. Arrays within this array with be flattened.

array.join() as Text
array.join(separator as Text) as Text

Parameters

  • separator. Optional Text object. This will be inserted between each element in the returned Text object. If not specified then the elements will be joined together with no spacing between

Returns

  • A new Text object

Example

var a = [1, 2, 3, ["x", "y"]]
a.join() # => "123xy"
a.join("-") # => "1-2-3-x-y"