Skip to content

Instantly share code, notes, and snippets.

@ranamahmud
Created November 4, 2020 13:40
Show Gist options
  • Save ranamahmud/a56c8cc7b5627409e6875ef06813814a to your computer and use it in GitHub Desktop.
Save ranamahmud/a56c8cc7b5627409e6875ef06813814a to your computer and use it in GitHub Desktop.
var sum = function(a, b){
var res = a + b;
return res;
}
sum(5,10);
// 15
var sumDefault = function(a, b = 10){
var res = a + b;
return res;
}
sumDefault(15)
// 25
sumDefault(15,5)
// 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment