As usual, start by running the specs and reading the results. Then fix some things, run the tests again, and repeat.
You're probably pretty good at this right now — good luck!
Remember the purpose of using
(), like simply
functionName, will return the function but NOT run it. You'll see the return value as
To get our code to execute that function, we instead call
functionName(), which executes the code within that function.
As an example, the third test here at first returns:
Error: Expected [Function: funkyFunction] to equal 'FUNKY!'
We can make the function execute by saying this:
var theFunk = funkyFunction() But this returns ANOTHER FUNCTION! How would we tell that function to execute to return the string within it?
View Fix The Scope Lab on Learn.co and start learning to code for free.