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
Top comments (0)