Closed danialmalik closed 5 years ago
Yes, I already searched for this issue
Edition: 2nd
Book Title: ES.Next & Beyond
Chapter: 02: Syntax
Section Title: Block-scoped Functions
Problem: In the first code block, i.e.
{ foo(); // works! function foo() { // .. } } foo(); // ReferenceError
in the later call to foo, a ReferenceError is expected. But when I run the code using node, there is no error there.
foo
ReferenceError
node
➜ ydkjs: node Welcome to Node.js v12.7.0. Type ".help" for more information. > { ... foo(); // works! ... ... function foo() { ... console.log('Called'); ... } ... } Called [Function: foo] > > foo(); Called undefined >
This book has not been worked on in second edition yet.
Yes, I already searched for this issue
Edition: 2nd
Book Title: ES.Next & Beyond
Chapter: 02: Syntax
Section Title: Block-scoped Functions
Problem: In the first code block, i.e.
in the later call to
foo
, aReferenceError
is expected. But when I run the code usingnode
, there is no error there.