Last active
March 23, 2018 16:02
-
-
Save aonrobot/19d640e97964af248e62b9e250acf9f3 to your computer and use it in GitHub Desktop.
Pure Function @medium.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = {value : 10}; | |
function pureFunc(arg){ | |
let a = 2; | |
arg = arg * a + 20; | |
return arg; | |
} | |
var result = pureFunc(data.value); //result = 40 | |
var result = pureFunc(data.value); //result = 40 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment