Assignment immutability vs Value immutability
const x = [1,2,3] x = 4 // TypeError : assignment to constant variable x[1] = 10 x become [1,10,3] as array is mutable value. Here ‘const’ keyword provides assignment immutability. When we talk of immutability in general, we mean value immutability. Also, const keyword is block scoped. So it doesn’t affect anything outside the […]