Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
function eats(fruit1, fruit2, fruit3) {
console.log('Baby eats :- ', fruit1 + ', ' + fruit2 + ' and ' + fruit3);
}
let fruits = ['apple', 'mango', 'banana'];
eats(...fruits);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment