Closed dijs closed 11 years ago
This actually sounds like a pretty useful feature. Something like:
function my_function(x=1,y=2)
print x + y
my_function() # prints 3
my_function(10) # prints 12
my_function(10,20) # prints 30
Implemented as something like:
function my_function (x, y) {
if (x == null) x = 1;
if (y == null) y = 2;
console.log(x+y);
}
my_function();
my_function(10);
my_function(10,20);
Any other ideas?
Exactly! Shouldn't be too hard to add.
Thank you for the suggestion, @rompetoto. This is a great feature to have.
This would be so cool!