Dealing with stateful computations can be a challenge when writing purely functional JavaScript. They can result in undesired variable declaration at be...