JS Syntax
  • Introduction
  • this
  • block-level scope
  • ===
  • inefficient DOM manipulation
  • Reference equality, shallow equality and deep equality
  • D3 - 2
  • D3 - 5
  • D3 - static
Powered by GitBook
On this page
  • variable hoisting
  • let

Was this helpful?

block-level scope

for (var i = 0; i < 10; i++) {
  /* ... */
}
console.log(i);  // what will this output?

should be undefined for other languages, but 10 for JS.

variable hoisting

Variable i remains in scope even after the for loop has completed, retaining its last value after exiting the loop.

let

The support for block-level scopes is available for the new let keyword.

PreviousthisNext===

Last updated 5 years ago

Was this helpful?