DEV Community

Discussion on: Functional Programming Principles in JavaScript

Collapse
 
jackmellis profile image
Jack

Put simply, the input itself is impure. The valueOf getter uses performance.now which is external state (calling valueOf with the same inputs does not return the same result every time). When you introduce impure inputs then you’ve already broken the fp paradigm.