This is a philosophical question. JavaScript almost exists in a quantum state where you cannot tell if it is pure or impure, unless you use the code. That pretty much sums up the article.
Except I don't think that's really true. Getting something's value is calling a function, so if that function's impure then yeah, any function that calls it will be impure. OTOH, as long as the function to get something's value is pure (ie 99.9% of cases) your pure function will actually be pure.
5
u/[deleted] Aug 27 '16 edited Aug 27 '16
This is a philosophical question. JavaScript almost exists in a quantum state where you cannot tell if it is pure or impure, unless you use the code. That pretty much sums up the article.