-1

I've read the MDN:Scope document and other resources but feel genuinely stuck.

var funkyFunction = function() {
  return function() {
    return "FUNKY!"
  }
}

// We want to set theFunk equal to "FUNKY!" using our funkyFunction.
// NOTE: you only need to modify the code below this line.

var theFunk = funkyFunction()
theFunk()
philipxy
  • 14,867
  • 6
  • 39
  • 83
zephyr
  • 11
  • 1
  • Does this answer your question? [What is the scope of variables in JavaScript?](https://stackoverflow.com/questions/500431/what-is-the-scope-of-variables-in-javascript) –  Apr 05 '20 at 08:37
  • 1
    There is no question in this post. – philipxy Apr 05 '20 at 08:52
  • I needed clarification on invoking that internal function using the //marked-out// directions. I should have included more detail in my post though you are right. Thank you both for your responses. I will also refer to that link now. – zephyr Apr 07 '20 at 07:05

1 Answers1

0

funkyFunction returns a function. You need to call that function immediately, so that it returns "FUNKY!" and gets assigned to theFunk:

var funkyFunction = function() {
  return function() {
    return "FUNKY!"
  }
}

// We want to set theFunk equal to "FUNKY!" using our funkyFunction.
// NOTE: you only need to modify the code below this line.

var theFunk = funkyFunction()();
console.log(theFunk);
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320