Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bhaveshdaswani93/1de1e08918ebfc750f256190f4008af3 to your computer and use it in GitHub Desktop.
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
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