9th March 2021
One of the features that came with ES6 is the addition of let and const, which can be used for variable declaration. The question is, what makes them different from good ol’ var which we’ve been using? If you are still not clear about this, then this article is for you. In this article, we’ll discuss var, let and const with respect to their scope, use, and hoisting. As you read, take note of the differences between them that I’ll point out. Var Before the advent of ES6, var declarations ruled. There are issues associated with variables declared with var, though. That is why it was necessary for new ways to declare variables […]