Minefield Engineer at kilroySoft. Clojure addict in a non-addicted country. Clojure Users and ClojureScript Users groups Manager on LinkedIn. Business Apathetic... ;)
result is an external state, initialized outside the function. myCount() will give a different response, every time you call it. There's a side effect on i inside the loop.
That's anything except a pure function.
Pure function:
Its return value is the same for the same arguments (no variation with local static variables, non-local variables, mutable reference arguments or input streams from I/O devices).
Its evaluation has no side effects (no mutation of local static variables, non-local variables, mutable reference arguments or I/O streams).
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.
Agreed
result
is an external state, initialized outside the function.myCount()
will give a different response, every time you call it. There's a side effect oni
inside the loop.That's anything except a pure function.
Pure function: