
Sometime you might ask yourself that why JavaScript came up with let and const in ES6, although var is already there. I will answer it at the end. There are many benefits of using let and const over var. I will not go through all of these.
To understand the temporal dead zone in a simple words, please go through my blog, “Let, const and Temporal dead zone” .