Answer the question
In order to leave comments, you need to log in
Destructuring assignment in Ruby?
Hello, is there a possibility in Ruby of destructive assignment, such as in JS
For example
({a, b} = {a:1, b:2, c:3, d:4});
console.log(a);
console.log(b);
obj = {a:1, b:2, c:3, d:4}
a = obj[:a]
b = obj[:b]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question