Skip to content

Instantly share code, notes, and snippets.

@softwarespot
Created September 1, 2015 09:46
Show Gist options
  • Save softwarespot/44ec4e06cb86da69e58e to your computer and use it in GitHub Desktop.
Save softwarespot/44ec4e06cb86da69e58e to your computer and use it in GitHub Desktop.
A simple demo of some of the new features of ES2015
// Example of using ES2015
// IIFE
(() => {
// Example of using rest params
function main(...args) {
// Cache length to increase performance
for (let i = 0, length = args.length; i < length; i++) {
// Display in the browser console
console.log(args[i]);
}
}
// Call main with a random number of arguments
main('a', 'b', 'c');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment