Hey community,
I’ve looked this over multiple times, it looks identical as far as I can tell, but am getting the error shown below. Please assist!
Hey community,
I’ve looked this over multiple times, it looks identical as far as I can tell, but am getting the error shown below. Please assist!
When you write function
a function declaration is expected. To execute the function, you just write the function name followed by ()
in this case. With your current code, it appears to JavaScript that you are trying to declare another function named resusableFunction
instead of executing it.
The video on this lesson: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions
…Is showing a semi colon at the end when calling. Is that not common practice?
To invoke the function you do not write function
again in front. The keyword function
is just to declare reusableFunction
as a function.