Top result from googling "var javascript block scope":
The var keyword behaves differently in function scopes and block scopes. A variable declared with var in a function scope can't be accessed outside that function scope. A variable declared with var in a block scope is available outside of that block scope.
Your let b = ... is within the if (...) { ... } block and is destroyed when leaving the block. The var a = ... will live outside the block.
As for the let = ..., async = ... and await = ... assignments, all three of those are being assigned as variables because or your beginning var ... syntax. It wouldn't be good to make variables with these names anyway and your console highlighting them is evidence of this bad practice (IMHO you should be prevented from creating those variables as those names should be reserved, but that could break compatibility between versions.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top result from googling "var javascript block scope":
Your
let b = ...
is within theif (...) { ... }
block and is destroyed when leaving the block. Thevar a = ...
will live outside the block.As for the
let = ...
,async = ...
andawait = ...
assignments, all three of those are being assigned as variables because or your beginningvar ...
syntax. It wouldn't be good to make variables with these names anyway and your console highlighting them is evidence of this bad practice (IMHO you should be prevented from creating those variables as those names should be reserved, but that could break compatibility between versions.)