In Step 3, the lesson asked for using a const to write a function, that would mean using function expression instead of function declaration like what you’ve written above.
I think if you change how the function is written using const, you will pass Step 4 when you run it again. The console.log is fine.
For more reading about function declaration vs function expression, I’ve included some documentation links below. Essentially both ways are good to write a function, it’s just there’re some aspects that are different (hoisting is one of it).
Small note:
Thanks for using the markdown for code and passing the important information, it helps a lot.
I would suggest copy the quotation marks from the lesson as well, using single quotes. Sometimes, the validation might be very unforgiving, might want to eliminate all those possibilities of throwing out error.
Scope is everything if you’re a variable. There is no jumping lines in this environment. It is also the concept that messes with lots of learners. We have to first envision enclosures within enclosures. Scope is described as a chain but each link is an enclosure. Start with that.
Yep that’s what I missed, so really it should have stopped me a step earlier and noticed that I didn’t follow the directions to write the function expression correctly. Thanks!