0
In the tutorial sayed the primitive values can't change,but it can change actually!!!why?
for example: var a = 5; a=3; the output is 3,so I think it's changed! isn't it?😞
3 Réponses
+ 1
It changed because you have assigned to the variable another value different from the previous one. May be I did not understand your question. Could you be more clear?
+ 1
in JavaScript,we have primitive values, primitive values are those values that cannot change.but when i assign a new value to the variable,the value will change.i confused about that!!
+ 1
I think you have a misunderstanding between primitive values and variables, I hope this documentation could help you https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Primitive_values