Hi there
In VB there was function overload and I believe java has something like that too, ie defining a function multiple times but with different initialization parameters. Well, this is necessary it, but something interesting, I have just came across.
Which is valid javacript. I'm curious...
Thanks in advance...
In VB there was function overload and I believe java has something like that too, ie defining a function multiple times but with different initialization parameters. Well, this is necessary it, but something interesting, I have just came across.
B4X:
function sum() {
let result = 0;
for (const argument of arguments) {
result += argument;
}
return result;
}
sum(5, 8); // 13
Which is valid javacript. I'm curious...
Thanks in advance...