Created
December 22, 2019 12:37
-
-
Save bhaveshdaswani93/1de1e08918ebfc750f256190f4008af3 to your computer and use it in GitHub Desktop.
Pure function should qualify with if there is same input the output should be same no matter how many times it is called
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
function addTwoNumber(num1,num2) { | |
return num1 + num2; | |
} | |
addTwoNmber(3,4); // will return 7 no matter how many times is called | |
function multiplyWithCurrentTime(num) { | |
return num * new Date().getTime(); | |
} | |
multiplyWithCurrentTime(3);// will provide new output each time we call the funciton |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment