It will be useful in interview point of view
What is Idempotence?
Idempotence is sometimes a confusing concept, at least from the academic definition. From a RESTful service standpoint, for an operation (or service call) to be idempotent, clients can make that same call repeatedly while producing the same result.
Definitely, it will be confusing. I know, But this the explanation from the internet. But the best part is, it is soo easy.
If something is running over and over again, but resulting in the same value all the iteration or times is called Idempotency.
When do we call a function Idempotence?
When a function is called over itself many times but when it results the same value is called Idempotence function.
See Abs is nothing but it returns the absolute value here the above example will always return 10 as a result. So it is called an idempotence function.
Where do we use?
If you ever worked with HTTP in API calling functionality. The GET request is actually an idempotence thing. When you send get request over and over, but the value remains the same as it said to idempotence.
That’s it, readers. It is one of the interview questions. It is common for all languages, so you can face interviews with confidence.
See you all in the next story.