3 ms·
So I'm comparing pipe usage to this e.g. const result1 = square(2); const result2 = increment(result1); const result3 = square(result2); With the
by seanwilson 9y ago
So I'm comparing pipe usage to this e.g.
const result1 = square(2);
const result2 = increment(result1);
const result3 = square(result2);
With the above, I can add in a breakpoint and inspect what's going on at each stage with access to other debugging tools. Log statements don't seem nearly as good as this. The above is nice as well in that you can give intuitive names to the intermediate results.
- djedr 9y agoIf you need names for intermediate results, etc. then you don't want the pipeline operator/function. In such cases the things you say are true. But when you wan't to be more concise, with the operator/function, you can. BTW A nice feature of a code editor would be if you could magically switch back and forth between code with intermediate named variables and pipelined version of the same code, e.g. by selecting the code and invoking an option.