👀 var, let, const in javascript . just 30sec
Kaziu

Kaziu @kaziusan

About: Frontend Engineer Experience Backend as well ✈ backpacker

Location:
🇵🇱 or 🇯🇵
Joined:
Aug 12, 2019

👀 var, let, const in javascript . just 30sec

Publish Date: Sep 25 '22
0 0
redeclare reassign scope initialize
let 🗳 block
const 🗳 block
var function "undefined"

💎 const

the word const comes from constant, so it shouldn't change at all.

  • redeclare -> NO❗
  • reassign -> NO❗
  • scope -> block! We protect const in block !!
  • initialize -> of course NO❗

💎 let

let is actually almost const except one thing

  • reassign -> OK ✅

💎 var

var is so much freedom man, it's not recommended now


▼ and difference of hoisting, I've wrote about it in other article

Comments 0 total

    Add comment