0

In JavaScript Primitives it is written:

Primitive values are immutable (they are hardcoded and therefore cannot be changed).

What does it mean?

Sonevol
  • 290
  • 3
  • 12
  • 2
    The part about being hardcoded is pretty nonsensical, in typical W3S fashion. – deceze Aug 12 '17 at 19:46
  • 1
    What it basically means, is that you can change the value of a variable (`x = "a"`), but you can't change the value of a primitive value (`"a" = "b"` won't work) – blex Aug 12 '17 at 19:47
  • 2
    Please do not refer to W3Schools for anything. They run a highly search-engine-optimized advertising business, not a web technologies documentation. Disregard their search hits, turn to the actual documentation instead. – Tomalak Aug 12 '17 at 19:49
  • @blex thanks for the answer. Obviously my question is not duplicate as it is no way related to said question. Please provide your comment as answer and remove the duplicate tag. – Sonevol Aug 12 '17 at 19:49
  • @Tomalak Please look at answer by blex and you will see how the question is not duplicate. – Sonevol Aug 12 '17 at 19:54
  • 1
    I agree that the mentioned question is not a duplicate of this one. Sorry, I don't have enough rights to remove the flag, and therefore I can't answer. However, I think people with more knowledge will be able to explain this better if your question gets re-opened. – blex Aug 12 '17 at 19:55
  • Here's another duplicate. One among many. https://stackoverflow.com/questions/16115512/understanding-javascript-immutable-variable – Tomalak Aug 12 '17 at 20:04
  • And another one. You could have searched. https://stackoverflow.com/questions/21971503/why-are-javascript-primitive-variables-immutable-and-object-variables-not – Tomalak Aug 12 '17 at 20:05

0 Answers0