我有点困惑,维基百科(我知道,我知道)将不变性定义为
immutable object is an object whose state cannot be modified after it is created.
而JS实现示例说明
In JavaScript, some built-in types (numbers, strings) are immutable
我现在明白在JS both Numbers and Strings are Objects但是当我可以清楚地改变任何Number或String变量的值时,为什么它们会被认为是不可变的?