5 ms·
It's ambiguos at best `foo(...)` normally means "call `foo`, but not with pipes function foo(str) { return `wrap(${foo})` } function bar(
by _ZeD_ 5y ago
It's ambiguos at best
`foo(...)` normally means "call `foo`, but not with pipes
function foo(str) {
return `wrap(${foo})`
}
function bar(prefix) {
return function(str) {
return prefix + str;
}
}
'hello' |> foo;
'hello' |> foo($);
'hello' |> bar;
'hello' |> bar($);
'hello' |> bar('myprefix');
'hello' |> bar('myprefix')($);
What of those expression does the right thing?