'How to create the function to give that result
The function that will take over all the arguments needs to be created, and I don't understand what part of [1].a(3)
const add = () => {
}
add(1)(2)[1].a(3) // 1+2+3 = 6
Solution 1:[1]
const add = (first) => {
return (second) => {
return [
undefined,
{
a: (third) => first + second + third
}
];
}
}
let result = add(1)(2)[1].a(3);
console.log(result);
:)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BrunoT |
