2 ms·
I believe you are misunderstanding how this new feature works in Ruby. You've brought up destructuring assignment in javascript which flows right-side values by
by latortuga 6y ago
I believe you are misunderstanding how this new feature works in Ruby. You've brought up destructuring assignment in javascript which flows right-side values by key to left-side variables. In Ruby, this new syntax is "rightward" assignment, values flowing from left to right:
3 => x # assigns 3 to x
[4, 5] => [x, y] # assigns 4 to x, 5 to y
- speedgoose 6y agoIndeed. It's very different. Thanks for the clarification.