In our applications it is often useful to be able to represent the possible absence of a value. In JavaScript we have undefined to represent the result of trying to access something that was never defined to begin with, and we havenull to assign to values that might have a value but could also be empty. These two are often conflated and used interchangeably both at the core language level and in libraries, but both are used to communicate the lack of a value where it is possible to find one.

For example, consider the function Array.prototype.find

Heads up: this post is way old, I’m just cross-posting it. It was originally written in March 2016 which is basically the Roman Empire on frontend programming timelines. Also I was not good at writing then. I’m still not, but I wasn’t then either.

The (|>) operator is, in my opinion, one of the most elegant features of the Elm language. It lets us read function applications in the order the actually happen and this readability gain can have a hugely positive influence on our API and application design. While this operator is generally useful for expressing data transformations, it has a particularly nice fit for building large or high-complexity configuration objects more expressively. …

Luke Westby

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store