Please consider the following code below:
function fun() {
return (true)
? () => true //This one returns a function instead of true
: false
;
}
Please consider the following code below:
function fun() {
return (true)
? () => true //This one returns a function instead of true
: false
;
}
To call the function returned, you would have to write:
fun()(); // true
Or you could rewrite to execute the function when it is defined:
function fun() {
return (true)
? (() => true)()
: false
;
}
fun(); // true
Thanks man