✅stop using var❗️
"var" has a lot of problems, don't use it.
Last updated
"var" has a lot of problems, don't use it.
Last updated
JS ⟩ variable ⟩ var ⟩ stop using var
var is a statement❗️(side effects)
global var / function is global object property❗️(side effect)
accessing var before declaration gets undefined❗️(unexpected result)
var has no block scope❗️ (unexpected result)
var in block can't shadow outer let❗️(unexpected result)
var can shadow parameter even in strict mode❗️(bad practice)
var redeclaration applied even in strict mode❗️(bad practice)