r/javascript • • Aug 27 '16

Is your JavaScript function actually pure?

http://staltz.com/is-your-javascript-function-actually-pure.html
8 Upvotes

48 comments sorted by

View all comments

12

u/memeship Aug 27 '16

• The elements in the array don’t have their valueOf functions tampered with

This possibility means literally nothing in JS is pure.

Also, why the hell does this arbitrary designation matter? Programmatic functions are not mathematical functions, their purpose is completely different.

2

u/[deleted] Aug 27 '16

Programmatic functions are not mathematical functions, their purpose is completely different.

That's very true. IMHO the article was great, but the example did not help make the point clear enough.