In one of the previous articles, we discussed the need for chaining several functions, and how to do them using the this
operator. While this works fine, there are several drawbacks to using this method:
this
. And the value must be stored in the this
operator so that the functions chained later on gets to access this value.functionA().functionB().functionC().functionD().......functionZ()
.To reduce the effects of these two caveats, the implementation of pipe()
and compose()
functions can be used.
#javascript #frontend #javascript-tips #frontend-development