Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Last active July 4, 2019 10:40
Show Gist options
  • Save indreklasn/0d33b59f46e128cfcc6aa66b1271f7f9 to your computer and use it in GitHub Desktop.
Save indreklasn/0d33b59f46e128cfcc6aa66b1271f7f9 to your computer and use it in GitHub Desktop.
const add = (a, b, ...[c, d, e]) => {
console.log(c) // 3
console.log(d) // 4
console.log(e) // 5
return a + b + c + d + e
};
add(1, 2, 3, 4, 5); // 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment