Skip to content

Instantly share code, notes, and snippets.

@rahulmalhotra
Created January 21, 2021 10: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 rahulmalhotra/96f27f326efed75002d23670a5e6692b to your computer and use it in GitHub Desktop.
Save rahulmalhotra/96f27f326efed75002d23670a5e6692b to your computer and use it in GitHub Desktop.
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
// * Spread Operator in JavaScript ES6
function eats(fruit1, fruit2, fruit3) {
console.log('Baby eats :- ', fruit1 + ', ' + fruit2 + ' and ' + fruit3);
}
let fruits = ['apple', 'mango', 'banana'];
eats(fruits[0], fruits[1], fruits[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment