Array.join

join — Joins the elements of an array into a string.

Description

Array.join([string separator])

Parameters

Name Description Type Default Optional
separator string Yes

Return values

string primitive.

Examples

Example #1 – join example
var array = [2, 4, 8, 16]; console.log(array); // [2, 4, 8, 16] console.log(array.join()); // 2,4,8,16 console.log(array.join(';')); // 2;4;8;16

External references