next up previous contents
Next: pop Up: Methods Previous: concat   Contents


join

Description

Converts the elements in an array to strings, inserts the specified separator between the elements, concatenates them, and returns the resulting string. A nested array is always separated by a comma, not by the separator passed to the join method.


Syntax

array1.join([separator])


Parameters

separator
A character or string that separates array elements in the returned string. If you omit this parameter, a comma is used as the default separator.


Returns

A String object For example:

a = new Array("a", "b", "c", "d");
b = new Array(a, "e", "f", "g", "h");
trace(b.join(`:'));
//output: a,b,c,d:e:f:g:h




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.