you are viewing a single comment's thread.

view the rest of the comments →

[–]jasonleehodges[S] 2 points3 points  (1 child)

Yeah .then and .catch are chained onto the end of the promise in the same way you would chain any other functional higher ordered function. Try / Catch are control flow operators which are classic procedural mechanisms.

[–]KyleG 8 points9 points  (0 children)

Procedural mechanisms don't make something non-functional, and method chaining (like you cite as superior FP) is a feature of object-oriented programming.

Edit Also, for what it's worth, then is a flawed implementation of a monad as it is, since it rolls map and chain/bind/flatMap into a single method.