has a variety of functions to help the programmer code faster as well as in an efficient manner. Today let’s look at two particular functions, and JavaScript ES6 let const. The use of and is done as an alternative to the function during the declaration of variables. Unlike , and are block scoped. Another difference that and have when compared to is the fact that while gives a error when accessed before declaring, and give a if they are accessed before declaration. let const var var let const let const var var undefined let const ReferenceError const does not allow reassignment The error is due to TDZ, or Temporal Dead Zone. TDZ starts at the beginning of the block where is declared and ends when is encountered again in the user code. let let TDZ is very useful as it helps to avoid bugs which appear when a variable is changed before its declaration is reached. While and are similar, they are not exactly the same. The main difference between and is that variables need to be declared using an initializer, or it will generate an error. let const let const const let will prevent mistakes of trying to redeclare an already declareed variable Also declaration of the variable with the same name will throw an error. This helps to fix mistakes where one loses a reference when a variable is reassigned. Let and Const are already replacing Var in many codebases, and are additional features of ES6 that will improve code. is how hackers start their afternoons. We’re a part of the family. We are now and happy to opportunities. Hacker Noon @AMI accepting submissions discuss advertising &sponsorship To learn more, , , or simply, read our about page like/message us on Facebook tweet/DM @HackerNoon. If you enjoyed this story, we recommend reading our and . Until next time, don’t take the realities of the world for granted! latest tech stories trending tech stories