What is an Impure Function in JavaScript?

What is an Impure Function in JavaScript? An impure function is a function that: ❌ Changes data outside its scope (side effects)❌ Depends on external variables that can change❌ Produces different outputs for the same input Example: Why is this…
