3 ms·
Just for comparison: b, a = a, b is actually valid code in Lua (and works as expected). Grabbing only one value looks like this _, y = returnsTwoValues
by copx 13y ago
Just for comparison:
b, a = a, b
is actually valid code in Lua (and works as expected).
Grabbing only one value looks like this
_, y = returnsTwoValues() -- grab only the second
y = returnsTwoValues() -- grab only the first
- jfarmer 13y agoThis works similarly in Ruby: a,_ = two_values() _,b = two_values()