Language syntax

Array literal spread

Try the free JavaScript compiler

Consumes an iterable into a new array in iteration order. Missing ordinary array positions become explicit undefined elements. Copying is shallow and a noniterable source throws TypeError.

Formal Syntax & Structure

javascript syntaxjavascript
[...iterable]

Working Example

Example Snippetjavascript
console.log([..."ab", "c"].join(","));
JavaScript Reference