Any useful function returning void is definitely impure.
Even if it doesn't reference anything besides its parameters, it's still bound to mutate or otherwise bother the parameters.
A pure function:
has no effect on the world except returning something.
the return value depends only on the parameters.
One of the consequences of 2. is that when given the same parameters, it should always produce the same return value.
This is a useful dipping stick that demonstrates that functions that depend on eg time or randomness aren't 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.
Any useful function returning
void
is definitely impure.Even if it doesn't reference anything besides its parameters, it's still bound to mutate or otherwise bother the parameters.
A pure function:
One of the consequences of 2. is that when given the same parameters, it should always produce the same return value.
This is a useful dipping stick that demonstrates that functions that depend on eg time or randomness aren't pure.