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 to emerge.
var is function scoped
var variables can be re-declared and updated.
let is now preferred for variable declaration. It's no surprise as it comes as an improvement to var declarations. It also solves the problem with var that we just covered.
let is block scoped
let can be updated but not re-declared.
Variables declared with the const maintain constant values. const declarations share some similarities with let declarations.
const declarations are block scoped
const cannot be updated or re-declared
Follow Me On :
Facebook : https://www.facebook.com/profile.php?...
Github : https://github.com/Rehankhalil462
Instagram : / devtechcare
#var #let #const #js #javascript #difference #comparison #react #jsx #modern #es6 #ecmascript #2015 #modern #new #detailed #keywords #Complete #tutorial #hindi #urdu #for #beginners #course #project #form #validation #learn #crash #abdul #wali