Does throwing an exception make a function impure? I wouldn't have thought of JavaScript exceptions as being particularly stateful; as long as they are thrown reproducibly due to arguments or constants (not due to external or internal state) that doesn't come across as impure to me. I guess the stack property is based on where you call it from.
4
u/JamesWildDev Aug 27 '16
Does throwing an exception make a function impure? I wouldn't have thought of JavaScript exceptions as being particularly stateful; as long as they are thrown reproducibly due to arguments or constants (not due to external or internal state) that doesn't come across as impure to me. I guess the stack property is based on where you call it from.