Skip to content

Instantly share code, notes, and snippets.

@rahulmalhotra
Created January 21, 2021 11:16
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/ad110b11bcdbb76a7c0a04a69de4dfee to your computer and use it in GitHub Desktop.
Save rahulmalhotra/ad110b11bcdbb76a7c0a04a69de4dfee to your computer and use it in GitHub Desktop.
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
// * Rest Parameters
function car(name, ...features) {
console.log('Features of Car ' + name + ' are:- ');
features.forEach(feature => {
console.log(feature);
});
}
car('Audi', 'Great Speed', 'Good Color', 'Comfort', 'Good Looks');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment