Many languages ββhave an operator that allows you to transfer the results of one operation to a call to another (for example, the | operator in bash, the |> operator in F #).
One of the greatest advantages of my mind in spreading the idiom of method binding in javascript is that it reads from top to bottom, from left to right:
var fooOddSquares = [1, 2, 3, 4, 5] .filter(x => x % 2) .map(x => "foo" + x * x) .reduce(((acc, str, i) => acc[i + 1] = str; return acc), {});
compared to composite code:
var something = func5( func4( func3( func2( func1( somedata ) ) ) ) );
which is read from right to left, from bottom to top. I understand that this can be cleared with a functional composition, but this is not necessary. To be absolutely clear what I'm looking for:
var something = func1(somedata) |> func2 |> func3 |> func4
Performing a google search on a pipe statement in javascript basically provides information about the bitwise OR operation. However, with some digging, I was able to dig up this article describing a dirty hacked version of operator overload that could implement some of what I'm talking about. I also found this one that describes the statement mentioned and says that "it was suggested for javascript".
Looking at ES 2016, I see offers for the exponential operator and the binding operator. Both are useful, but not what I want. So, in the heading at the base, did anyone really suggest this for javascript?