DEV Community

Discussion on: Three dots ( … ) in JavaScript

Collapse
 
kozmicluis profile image
Luis Lopez

There's also function application:

function cube(x, y, z) {
  return x * y * z;
}

cube(...[2, 5, 10]);
//> 100

Using ... you can send an array as separate arguments.