ganqqwerty / 123-Essential-JavaScript-Interview-Questions

JavaScript interview Questions
BSD 3-Clause "New" or "Revised" License
5.01k stars 1.18k forks source link

16th Question - bug #112

Open ChinmayaBisoi opened 1 year ago

ChinmayaBisoi commented 1 year ago
var foo = function bar() {
  // foo is visible here
  // bar is visible here
  console.log(typeof bar());  // Works here :)  
};
// foo is visible here
// bar is undefined here

It should be like this instead, ( check the console.log )

var foo = function bar() {
  // foo is visible here
  // bar is visible here
  console.log(typeof bar); // Works here :)
};
// foo is visible here
// bar is undefined here
ChinmayaBisoi commented 1 year ago

@ganqqwerty P.s. thanks for the great repo, I hope you would take a look into the above issue