Post

An example of Hyrum's law in JavaScript I encountered this week (or is it?) A `divide(numA, numB)` function implemented partial application `if (numB == null) return n => divide(numA, n)`

0 reposts0 likes

Now that's ok I guess, until I found a callsite when it was being used `divide(undefined, undefined)` which instead of throwing or returning a number... would now return a function The code doing that would subsequently try to do some arithmetic on it, so it would end up producing NaN