Var {
Before the advent of ES6,
var declarations were used to declare a variable.
The properties of var is that it has visibility linked
to the function to which it belongs. We can change its value,
and it can be redeclared in the same scope.
Scope means where these variables are available for use.
There are two types of scope, local and global.
Var declarations are globally scoped,
and when they are defined inside a function, they are locally scoped.
}
let {
The variable type let is introduced in ES6.
It shares a lot of similarities with var,
but unlike var, it has scope constraints.
Its declaration and assignment are similar to var.
The purpose of introducing let is to resolve all issues
posed by variables scope, which developers face during development.
The properties of let are that
They have visibility linked to the block they belong with.
We can change their values,
but they cannot be redeclared in the same scope, unlike var.
}