One could say a pure function has the following characteristics:
- Deterministic: The same input values always produce the same output values
- No side effects: The function does not change any variables or objects that existed before it was called
- No external dependencies: The function does not read or write data from outside sources, such as files, databases, web services, or the console
And this would not be incorrect. However, rather than applying these criteria to a function in order to determine its purity, I think it's better to ask yourself and understand why is it important, and is it?