Skip to main content

ES6 add TDZ for Block Scope

improves behaviour of var hoisting undefined

!bad accessing variables before declaration is bad practice and should be avoided, which the TDZ helps enforce

TDZ is needed to make const variables work by making sure variables only callable after declaration

let & const were added as a work-around to prevent hoisting undefined

References