Array.toLocaleString

toLocaleString — Flattens the elements of an array into a string.

Description

Array.toLocaleString()

Return values

string primitive.

Examples

Example #1 – toLocaleString example
var array = [2, 4, 8, 16]; console.log(array); // [2, 4, 8, 16] console.log(array.toLocaleString()); // A string representation of the array using the local join character.

See also

  • Array.join()

External references