Skip to content

Instantly share code, notes, and snippets.

@suissa
Last active October 21, 2017 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suissa/1b5d6db960a855a1c96ffbf75f975fbf to your computer and use it in GitHub Desktop.
Save suissa/1b5d6db960a855a1c96ffbf75f975fbf to your computer and use it in GitHub Desktop.
const f = ( ...args ) => {
console.log( 'f args: ', args )
console.log( 'f ...args: ', ...args )
}
// f args: [ 2, 3, 4 ]
// f ...args: 2 3 4
const showArgs = ( ...args ) => {
console.log( 'args: ', args )
console.log( '...args: ', ...args )
return f( ...args )
}
// args: [ 2, 3, 4 ]
// ...args: 2 3 4
console.log( showArgs( 2, 3, 4 ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment