JavaScript fundamentals before learning React
robinwieruch.de
JavaScript fundamentals before learning React
1–10 of 72 posts
Re: JavaScript fundamentals before learning React
#2> Even though it is possible to mutate the inner properties of objects and arrays when using const, the variable declaration shows the intent of keeping the variable immutable though.
let and const only control mutability of the reference. They say nothing of the value mutability. const then can only be a signal that you are not reassigning to the identifier.
const is still useful as a default of course since reassignment is generally the exception.
Maybe this is what they meant but the language used made it seem otherwise.
Re: JavaScript fundamentals before learning React
#3This article has a lot to offer a JS + React beginner so it feels lame to reply to some tiny part of it, but this bit is a constant error propogated in the ecosystem: > Even though it is possible to mutate the inner properties of objects and arrays when using const, the variable declaration shows the intent of keeping the variable immutable though. let and const only control mutability of the reference. They say noth…
Re: JavaScript fundamentals before learning React
#4This article has a lot to offer a JS + React beginner so it feels lame to reply to some tiny part of it, but this bit is a constant error propogated in the ecosystem: > Even though it is possible to mutate the inner properties of objects and arrays when using const, the variable declaration shows the intent of keeping the variable immutable though. let and const only control mutability of the reference. They say noth…
Beginners don't know about references. What you say is exactly what the author meant.
Hi Swizec :wave: :)
Re: JavaScript fundamentals before learning React
#5This article has a lot to offer a JS + React beginner so it feels lame to reply to some tiny part of it, but this bit is a constant error propogated in the ecosystem: > Even though it is possible to mutate the inner properties of objects and arrays when using const, the variable declaration shows the intent of keeping the variable immutable though. let and const only control mutability of the reference. They say noth…
Beginners don't know about references. What you say is exactly what the author meant.
Re: JavaScript fundamentals before learning React
#6Earlier quoted context omitted.
Beginners don't know about references. What you say is exactly what the author meant.
Author here {: Yes, what you are saying here is what I meant. I didn't want to mix in the whole topic around "passing by value or reference" in this short teaser. Hi Swizec :wave: :)
Then you may want to say that `const` guarantees that the name will remain bound to that object.
The great-GP is correct in that `const` has nothing to do with immutability besides that. It doesn't necessarily conveys an intent of inner immutability. It just states that whatever is in the variable will stay there until it goes out of scope.
Using `const` whenever possible is good advice, off course.
Re: JavaScript fundamentals before learning React
#7Earlier quoted context omitted.
Author here {: Yes, what you are saying here is what I meant. I didn't want to mix in the whole topic around "passing by value or reference" in this short teaser. Hi Swizec :wave: :)
Hi, Robin. Then you may want to say that `const` guarantees that the name will remain bound to that object. The great-GP is correct in that `const` has nothing to do with immutability besides that. It doesn't necessarily conveys an intent of inner immutability. It just states that whatever is in the variable will stay there until it goes out of scope. Using `const` whenever possible is good advice, off course.
Re: JavaScript fundamentals before learning React
#8Re: JavaScript fundamentals before learning React
#9Hey, author here :) I am curious about your experiences using/learning React. Are there any other JavaScript topics which are important when starting out with React? Would be great hearing your opinion!