Tell us what’s happening:
its not working, cant see what s wrong
Your code so far
// Example
function ourReusableFunction() {
console.log("Heyya, World");
}
ourReusableFunction();
// Only change code below this line
ourReusableFunction() {
console.log("Hi World");
}
ourReusableFunction();
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36.
Challenge: Write Reusable JavaScript with Functions
foo() { ... } is method syntax and only valid inside an object or class. In all other places, you need to use the function keyword, or it’ll be interpreted as calling foo() then a syntax error as it hits the braces.
In your initial post you have named your function ourReusableFunction() and then called that same function. The challange that was given told that you need to name the function reusableFunction and after that to call it.
So the only difference in what you wrote and what was asked was the name of the function and for that reason you were failing the challange. I hope this is clear