liveBook · Manning

Variable declaration keyword

A variable declaration keyword is a programming-language keyword that introduces a variable binding.

How 2 Manning books explain it

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond

A JavaScript keyword that declares a block-scoped local variable whose binding cannot be accessed outside the block where it is declared.

How it is used
Keeps changing JavaScript variables local to blocks, especially loops, instead of letting function-scoped declarations escape their intended use.
How deep it goes
Explains block scope, loop behavior, hoisting, and temporal-dead-zone errors through examples, stopping at observable behavior rather than engine internals.
Examples
Contrasts delayed loop callbacks, hides data in a free-standing block, and challenges readers to remove IIFEs from a range function.
What you can do after
Practice/perform block-scoped declarations in loops and replace IIFEs used only to contain local variables.

Read how Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond explains variable declaration keyword →

Secrets of the JavaScript Ninja, Second Edition

A JavaScript keyword used to declare a variable binding, such as var, let, or const.

How it is used
Distinguishes JavaScript variable declarations by mutability and relationship to the lexical environment.
How deep it goes
Compares three declaration keywords by two properties: mutability and relationship to the lexical environment.
Examples
Names var, let, and const as the three declaration keywords.
What you can do after
Understand the comparison of var, let, and const by mutability and lexical-environment relationship.

Read how Secrets of the JavaScript Ninja, Second Edition explains variable declaration keyword →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.