Practice refactoring with ES2015 features.
CodeRoad is an open-sourced interactive tutorial platform for the Atom Editor. Learn more at CodeRoad.io.
-
install the tutorial package
npm install --save coderoad-es2015 -
install and run the atom-coderoad plugin
Using let & const.
let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used.
This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.
var global = true;
let blockScoped = true;Writing basic functions continued.
We'll write two more basic functions, this time without any help.