Category "immutability"

How can I create immutable DTOs using Jackson but without annotions?

Jackson can deserialize JSON data into immutable objects. But by default the constructor or static factory method parameters have to be specified either using @

Swift: What's the best way to pair up elements of an Array

I came across a problem that required iterating over an array in pairs. What's the best way to do this? Or, as an alternative, what's the best way of transformi

Replace element at specific position in an array without mutating it

How can the following operation be done without mutating the array: let array = ['item1']; console.log(array); // ['item1'] array[2] = 'item2'; // array is mut

Correct way to push into state array

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 value') }