Your addCharacters(char1) is also returning a function, which returns another function. You need to make another function call to access that innermost function reference for the .map() callback. JavaScript allows you to immediately invoke returned functions:
Example Code
myFunc(1)("hi");
Immediately invoke the function returned from your addCharacters(char1) call, and pass char2 as the argument.
To make it clear what I added in this step, it’s the bit at the very end: (charRange(char2))
Don’t know what I’m doing wrong. The instructions are poor.
Your addCharacters(char1) is also returning a function, which returns another function
I’m not so sure what these functions are. Are they charRange and elemValue?
access that innermost function
I’m guessing that’d be elemValue. But I tried that in the code, too and it didn’t work. I’m guessing I’m getting syntax wrong, but the example given doesn’t help much.
Thanks for your help!
I got it, thanks guys. But @lasjorg, I’m confused about how your code in the section “capture the inner return function” works.
Because addTwoTo is a variable, not a function, right? So how does “addTwoTo(40)” do anything? And why would it equate the number in the brackets (in our case 40) as being num2?
Your example under “invoke the inner treturn function immediately” makes sense to me.