string[],
                  
                  
                    ) {}
                  
                  
                  }
                  
                  
                  
                  
                  
                  const result = new Test(["a", "b"]);
                  
                  
                  
                  
                  
                  console.log(result)
                  
                  
                  
                  
                  
                  result.array = ["test"]
                  
                  
                  
                  
                  
                  console.log(result) - result.array has been mutated
                  
                  
                  
                  
                  
                  I'm kinda surprised by this, isn't the class instance supposed to be immutable without a setter?
                  
                  
                
No?
Стикер
no, I meant the class instance itself
Use immutable.js
Обсуждают сегодня