Modern JavaScript mostly uses let and const instead, because they behave more predictably. Scope differences. let is block-scoped. var is function-scoped.
Modern JavaScript mostly uses let and const instead, because they behave more predictably. Scope differences. let is block-scoped. var is function-scoped.Read more