On Tuesday, 24 May 2022 at 15:31:47 UTC, Adam D Ruppe wrote:
>On Tuesday, 24 May 2022 at 15:15:13 UTC, FeepingCreature wrote:
>Javascript, yes:
If you use var
, the variable is hoisted to the top-level scope of the function, so this behavior is then expected.
Use the let
keyword for a local lexically scope thing, and then you'll see the cb behavior is different.
Oh, I see!