2 ms·
Now replace def to_int(a, b): ... with the JS semantic equivalent of def to_int(*args): ... because that's how JS function declarations work. Yo
by qayxc 3y ago
Now replace
def to_int(a, b):
...
with the JS semantic equivalent of
def to_int(*args):
...
because that's how JS function declarations work. You simply have the option to assign names to positional parameters, i.e.
function fn(a, b) {
comnsole.log(a, b)
}
is just syntactic sugar for
function fn() {
const a = arguments[0]
const b = arguments[1]
console.log(a, b)
}
and that's what people seem to struggle with and argument over for whatever strange reason.