Hey @Maksim

Thank you for sharing your opinion! :)

I believe otherwise. I think if the function mutate an argument it is considered impure.

Just consider the scenario:

I gave the calculator ( 2 + 3 + 5 ) and it gave me back 8 instead of 10.

What happened? It did something "unpredictable".

The 4th example mutated the arguments. and did something "unpredictable". Therefore, I believe it is impure.

--

--

Front-end web developer and graduate student from Microverse.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store