I'm trying to solve this algorithm. I think I'm very close.
I need the seven
function to pass the a
variable to the timesFive
function. OR is there a way I can pass the * 5
operation from timesFive to seven in order to get the desired result?
- I'm not allowed to have variables outside of these two function scopes.
I can add another argument to timesFive as long as b remains the first argument.
function seven(action) { var a = 7; return action; } function timesFive(b) { console.log(a); // How can I access "a"? return a * 5; } console.log(seven(timesFive())); // Desired result: 35