June 2018
Beginner
288 pages
6h 31m
English
const and let are far better replacements for the old var to define variables. Moving forward, we should quit using var and use const where possible and choose let otherwise. These two have block scope, prevent accidental redefinition of variables, and offer much better programming safety. You also learned how to honor immutability when programming. Next you will learn about improvements in passing arguments to functions.
The following exercise problems will let you hone your skills about using use strict, avoiding var, and when to use let rather than const. Give these a try before heading over to the next chapter. You can find answers to these exerciseshere.
What’s the output of this code?
| | function first() { |
Read now
Unlock full access