Advertisement
728x90
Some of the major differences between pure and impure function are as below,
| Pure function | Impure function |
| ----------------------------------- | ---------------------------------------------------------------------- |
| It has no side effects | It causes side effects |
| It is always return the same result | It returns different result on each call |
| Easy to read and debug | Difficult to read and debug because they are affected by external code |
Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 16
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
445of476