JavaScript Variables and Bindings

Photo by Joshua Aragon on Unsplash

Let

let firstCounter = 5, secondCounter;
console.log(firstCounter)
//output -> 5
firstCounter = 1;
console.log(firstCounter)
//output -> 1
console.log(secondCounter)
//output -> undefined

Const

const thirdCounter = 3, fourth;
//output -> Error;
const fifthCounter = 5, sixthCounter = 6;
console.log(fifthCounter);
//output -> 5
fifthCounter = 15;
//output -> Error

Passionate reading || Coding Addicted || FullStack Web Developer from Costa Rica

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store