I found an interesting function while working on my latest project. I call it a memoization function.
The function stores the results in memory and returns immediately if called repeatedly with the same arguments. Such a function is suitable for some longer and demanding calculations.
That is nothing new, but it's a nice piece of code. ;)
Look at this: