ES6 lets you define functions like a => a * 2
Or (a, b, c) => a * b ^ c
Or (a, b, c) => a * b ^ c
JS:
let f = (a,b,c) => a * b ^ c;
f(2,3,4);
vs. Ruby: f = ->(a,b,c) { a * b ^ c }
f.(2,3,4)
Ruby's shorter and clearer. But, when you use the Ruby lambda more than once in the code, you lose the brevity advantage, because of the "extra" dot. But, in Ruby I use methods more than lambdas, which would be: def f(a,b,c) { a * b ^ c }
f(2,3,4)I would say the different is negligible here and claiming one is more clear than the other is purely preferential. Coming from a JS background the JS is more clear but not substantially enough for me to claim it is outright more clear a language syntax. Someone coming from a ruby background may argue the other direction.
Some languages are quite different but you are splitting hairs here and trying to be conclusive about it.
f = (a,b,c) => (a * b ^ c)