So I have this javascript code. There are 2 nested functions. How can I return a value to funcA()
inside funcB()
?
function funcA() {
funcB(() => {
//return funcA inside here
})
}
Is this even possible without doing it like the following?
function funcA() {
let returnValueA;
funcB(() => {
//change returnValueA inside here
})
return returnValueA;
}