getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
177.97k stars 33.41k forks source link

Ch1.md - Hoisting : Program doesn't produce error as mentioned in book and in fact hoists and return output. #1731

Closed purnimanagpal23 closed 3 years ago

purnimanagpal23 commented 3 years ago

The piece of code doesn't show reference errors anymore. In fact, it lets the variable hoist in block scope ending up showing values in the output.

I already searched for this issue

Edition: (pull requests not accepted for previous editions)

Book Title: Scope & Closures

Chapter: Chapter1: What's the scope

Section Title: Required Two Phases

Topic:Hoisting

getify commented 3 years ago

Your assertions and changes are not correct.

Screenshot 2021-05-01 160907