Skip to content

Instantly share code, notes, and snippets.

@aonrobot
Last active March 23, 2018 16:02
Show Gist options
  • Save aonrobot/9d498d0c9f3e903427939095d1df10d2 to your computer and use it in GitHub Desktop.
Save aonrobot/9d498d0c9f3e903427939095d1df10d2 to your computer and use it in GitHub Desktop.
var data = {value : 10};
function impureFunc(arg){
let a = 2;
arg.value = arg.value * a + 20;
return arg.value;
}
var result = impureFunc(data); //result = 40
var result = impureFunc(data); //result = 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment