Mutable vs immutable objects
I’m trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an … Read more
I’m trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an … Read more
I’m rebuilding an old Java project in Javascript, and realized that there’s no good way to do enums in JS. The best I … Read more
A frozen set is a frozenset. A frozen list could be a tuple. What would a frozen dict be? An immutable, hashable dict. … Read more
This question already has answers here: Why can’t strings be mutable in Java and .NET? (17 answers) Closed 9 years ago. As we … Read more
This question already has answers here: Java Immutable Collections (7 answers) Closed 2 days ago. From the Collections Framework Overview: Collections that do … Read more
If a tuple is immutable then why can it contain mutable items? It is seemingly a contradiction that when a mutable item such … Read more
I’m confused on what an immutable type is. I know the float object is considered to be immutable, with this type of example … Read more
This question already has answers here: Immutability of Strings in Java (26 answers) Closed 6 years ago. I wrote the following code on … Read more
Although I have never needed this, it just struck me that making an immutable object in Python could be slightly tricky. You can’t … Read more
I seem to be having issues pushing data into a state array. I am trying to achieve it this way: this.setState({ myArray: this.state.myArray.push(‘new … Read more