|
|
|
|
|
by tomtheelder
683 days ago
|
|
Depends on the language a bit, but a common feature in these languages is the tuple. Using a tuple you would end up with something like: let (value1, value2) = if (condition) { (8, 16) } else { (16, 256) } Or else you’d just use some other sort of compound value like a struct or something. Tuple is just convenient for doing it on the fly. |
|
I love destructuring so much, I don't know if I'd want to use a language without it anymore.