Fair question. This is javascript, right? In a dynamic language you can only write code in a functional style and hope that no one does a trick like the one you did there.
In your example inner becomes impure because valueOf is impure (it changes some state outside of its scope). So if an impure function gets executed inside of a "pure" function than it is no longer pure.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Fair question. This is javascript, right? In a dynamic language you can only write code in a functional style and hope that no one does a trick like the one you did there.
In your example
inner
becomes impure becausevalueOf
is impure (it changes some state outside of its scope). So if an impure function gets executed inside of a "pure" function than it is no longer pure.