News for hackers. Stuff that matters.
Re:JavaScript quiz that may confuse you by j16sdiz on Tuesday May 03, 2022 @05:40AM (#31246394)
The question have error.

You need to call `foo()` before the first `console.log` to get that behavior.

  function foo() {
      let a = b = 0
      a++
      return a
   }
 foo()     // <------ INSERT THIS
  console.log(typeof a)
  console.log(typeof b)

There are no comments on this comment yet.