const. I prefer both these declarations over
var because they remove some odd behaviors of
var and also offer more meaning to our code. Let's take a look at some of the major differences between these statements.
var statement declares a function-scoped, or globally-scoped variable. In…