2 ms·
JS/TS has y = { ...x, change: 'b' } And Swift avoids the mutability-problem all together, by providing structs with copy-on-write and self-mutating method
by SebastianKra 2y ago
JS/TS has
y = { ...x, change: 'b' }
And Swift avoids the mutability-problem all together, by providing structs with copy-on-write and self-mutating methods:
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/methods/#Modifying-Value-Types-from-Within-Instance-Methods https://docs.swift.org/swift-book/documentation/the-swift-pr...