Comments (10)
I feel like it should be mentioned somewhere, but probably the first lesson where its needed
from freecodecamp.
I think it is part of teaching strings.
Here is how MDN words it:
In JavaScript, primitive values are immutable — once a primitive value is created, it cannot be changed, although the variable that holds it may be reassigned another value.
But it would certainly be worth circling back to it when it becomes relevant to make sure the practical implication of it is shown.
from freecodecamp.
Good point! Reassigning variables is key. Perhaps mentioning immutability later reinforces the distinction between variable and data type
@NilsGke
from freecodecamp.
We should avoid parenthetical information like that whenever we can, in my opinion. It makes the sentence much harder to parse.
from freecodecamp.
Is it even worth mentioning here? The lesson doesn't show any consequences of immutability, so it might simply be better to remove the sentence.
from freecodecamp.
The description accurately mentions that strings in JavaScript are immutable, meaning their contents cannot be changed once created. However, it's important to clarify that while strings themselves are immutable, the variables holding them can be reassigned to new values. Therefore, no changes are necessary in this instance. @NilsGke
from freecodecamp.
I agree, the description is correct, though for someone encountering variables, strings and immutability for the first time, they might get confused, thinking they cannot change the variable as it is a string, which is immutable.
Two lessons later you learn how to reassign variables. Maybe not mentioning immutability at this early stage is the better choice.
from freecodecamp.
I would be fine moving it to somewhere closer to where something like array mutation is taught.
from freecodecamp.
I think we should at least update the text to say the variable can be reassigned another value.
This early on in the learning process, the difference between a "value" and a "variable containing a value", is likely not that well understood.
In some other challenge step, we then show what it actually means that a primitive value is immutable. After they know how to index into a value, then we can show an attempt to update an immutable value directly and explain why it doesn't work.
from freecodecamp.
Let's start there, then. A PR which resolves this issue will update the text:
Note that strings are immutable, which means once they are created, they cannot be changed.
To the text:
Note that strings are immutable, which means once they are created, they cannot be changed. The variable can still be reassigned another value.
from freecodecamp.
Related Issues (20)
- Calorie counter (js beta) project should teach why input fields cannot be retrieved early
- Editor get stuck after console opened HOT 7
- Decimal to binary converter - Step 99/100 - Confusing quotes HOT 9
- Decimal to binary converter - Step 105 - Unclear instructions
- Update the query of alert in `basic-css.spec.ts`
- Building a Platformer Game - Step 25 - Unclear hint HOT 5
- Count failed Project attempts towards the streak HOT 4
- doctype is referred to as a preamble in the specs
- Decimal to binary converter - Stack animation looks bad when default font is large HOT 5
- Music player - Step 70 - Adding example for ternary operator
- Algorithmic Thinking by Building a Dice Game - Step 1 - Text incorrect
- [Develop] Changed head/tail code is not updated in challenge HOT 1
- Allow all valid versions of browser alert HOT 1
- dice game step 9 (js beta) needs to fix one of the hints HOT 1
- cash register project sample app gives irregular results in repeated tests HOT 1
- Distinguish challenge tests expected to pass with seed code
- Step 55 | JavaScript Algorithms and Data Structures (Beta) HOT 5
- Pyramid Step 55 Common Sticking Point HOT 6
- Certifications on profile page should be rendered in a `ul`
- Learn Interfaces by-Building an Equation Solver Step 11 Typo HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecodecamp.