javascriptSpread syntax / Rest parameter

The three dots in Javascript are the Spread syntax or Rest paramater.

Spread syntax

The Spread syntax expands its content where multiple arguments are expected.

const firstNumbers = [1, 2, 3, 4, 5];
const allNumbers = [...firstNumbers, 6, 7, 8]; // this is [1, 2, 3, 4, 5, 6, 7, 8]

Rest parameters

This is used to create a function that has a non-finite number of parameters.

function doSomething(x, ...args) {}
doSomething("hi", 1, 2, 3, 4)

References