Use of Let, Var and Const in Javascript along with their Scopes
Use of Let, Var and Const in Javascript along with their Scopes The data type "var" can be used to redeclare or assign a variable n number of times without any troubles. But the data type "Let" can be initialised only once and cannot be initialized again and again. However it can be assigned n number of times but it cannot be initialised. What i essentially mean can be understood with the below given example: CASE 1 ( VAR Data type): Var Name = "Rishu"; // here i have initialised my variable "Name" and declared its value as // well as "Rishu"; Var Name = "Calc"; // re initialized the value of Name as "Calc" console.log(Name); // It will print Calc without any error CASE 2 ( Let Data type): Let Name = "Rishu"; // here i have initiali...