let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which declares a variable globally, or locally to an entire function regardless of block scope.
Why you should use Let instead of VAR?
let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.
Why is let safer than VAR?
var does not have a lexical scope; instead, it has a global scope, whereas let has to block scope, which can be implicit or explicit based on the let statement's placement. ... It is no safer to use the type of on the identifiers declared using the let statement, which the case is different for the var declared variables.