Live data from Hacker News

JavaScript fundamentals before learning React

robinwieruch.de

71–72 of 72 posts

Re: JavaScript fundamentals before learning React

#71
post #12

Earlier quoted context omitted.

'const prevents reassignment' is a much simpler way of saying that. Mutability doesn't need to come into it.

While it is simpler, I think it's better that people actually understand the difference between a reference to a value and the value itself. "Pointers are hard" is a statement that many beginner programmers make, but if you don't understand the concept, you will always be limited as a programmer. And whether you say "can be reassigned" or "mutable" (which means exactly he same thing, BTW) it doesn't really matter. JS…

> "can be reassigned" or "mutable" (which means exactly he same thing, BTW)

I have never used 'mutable' to describe a variable, but rather only to what it references. Perhaps it's more lax in js-land. Why would you call something that's atomic ally changed anything other than assignment?

Re: JavaScript fundamentals before learning React

#72
post #12

Earlier quoted context omitted.

'const prevents reassignment' is a much simpler way of saying that. Mutability doesn't need to come into it.

While it is simpler, I think it's better that people actually understand the difference between a reference to a value and the value itself. "Pointers are hard" is a statement that many beginner programmers make, but if you don't understand the concept, you will always be limited as a programmer. And whether you say "can be reassigned" or "mutable" (which means exactly he same thing, BTW) it doesn't really matter. JS…

> And whether you say "can be reassigned" or "mutable" (which means exactly he same thing, BTW) it doesn't really matter.

They don't mean the same thing, so it matters.

None of your comment about booleans etc is relevant. `const` prevents reassignment and that is all, it literally has nothing to do with mutability.

If you bring mutability into the conversation you've confused something simple.

Post reply on HN