Skip to content

Instantly share code, notes, and snippets.

@jorovipe97
Created September 12, 2017 15:16
Show Gist options
  • Save jorovipe97/5ac21e34ae4ff845e1240ce57a35e7e1 to your computer and use it in GitHub Desktop.
Save jorovipe97/5ac21e34ae4ff845e1240ce57a35e7e1 to your computer and use it in GitHub Desktop.
var a1=2;
var a2=4;
function sum(a, b) {
var res=0;
var sum = 0;
var i = 0;
while (i < b) {
sum = sum + a;
i++;
}
res = sum;
return res;
}
console.log(sum(a1, a2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment