Snippets Collections
const person = {
  name: 'Sam',
  age: 300,
}

const twinPerson = {
  ...person
}
// bad
function concatenateAll() {
  const args = Array.prototype.slice.call(arguments);
  return args.join('');
}

// good
function concatenateAll(...args) {
  return args.join('');
}
star

Tue Oct 12 2021 13:32:02 GMT+0000 (Coordinated Universal Time)

#javascript #spread #object #oop
star

Thu Aug 19 2021 17:41:31 GMT+0000 (Coordinated Universal Time) https://github.com/airbnb/javascript

#arguments #spread

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension