Sometimes I want to assign a variable the result of an Arrow function, but if I assign the Arrow Function to that variable it get the function and not the return of that Function as is obvious.
let theNumber2 = ()=>{return 2};
theNumber2
will contain the function and only if I do theNumber2()
I will get returned 2.
Is there a way to do something like this to get directly the return of the arrow function? For example:
let theNumber2 = ()=>{return 2}(); // Note the () at the final
Does there exist something to do that? I mean, to assign the arrow function called?