Skip to content

Instantly share code, notes, and snippets.

@lricoy
Created March 23, 2016 01:51
Show Gist options
  • Save lricoy/75d761e9ee7e19d934ed to your computer and use it in GitHub Desktop.
Save lricoy/75d761e9ee7e19d934ed to your computer and use it in GitHub Desktop.
ES2015 Spread
function f(x, y, z) {
// x === 1, y === 2, z === 3
return x + y + z;
}
// Passa cada elemento do vetor como um argumento
f(...[1,2,3]) == 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment