3 ms·
> Also, in this case, the function should return NaN so it's not polymorphic. Sure. But what if that's function comes from a 3rd party component that doesn't h
by qayxc 5y ago
> Also, in this case, the function should return NaN so it's not polymorphic.
Sure. But what if that's function comes from a 3rd party component that doesn't have great documentation or relies on another package and thus a behaviour like this simply bubbles up through the call chain?
And don't think this can't happen - NPM in particular notorious for this kind of deep dependencies. Also mixins and monkey patching are a thing in JS, so just importing a module can lead to an unexpected change in behaviour.