There’s a stage 0 proposal for pattern matching in JavaScript. In this article we’ll take a look at what the proposal entails and also show how you might find it useful. The proposal document has a few code examples, as usual. Here is one of them. let length = vector => match (vector) { { x, y, z }: Math.sqrt(x ** 2 + y ** 2 + z ** 2), { x, y }: Math.sqrt(x ** 2 + y ** 2), [...]: vector.length, el
