Cant see why its not working

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

Link to the challenge:

Check once more how you should name the function

is that a hint? lol i checked it looks like it should work i dont see anything wrong

You need to do these two things

  1. Create a function called reusableFunction which prints "Hi World" to the dev console.
  2. Call the function.

Compare once more the task and your solution. You should see the difference

my bad i was looking the wrong problem when i wrote that

I figured, no problem…

reusableFunction() {

console.log(“Hi World”);

}

reusableFunction();

how is that different than what i put?

Well, in your first post you were naming the function ourReusableFunction()
Now it looks good

if u see it please let me know im assumin its super simple to you but im looking and do NOT see the difference

its still not working
SyntaxError: unknown: Unexpected token, expected “;” (9:19)

7 |
8 | // Only change code below this line

9 | reusableFunction() {
| ^
10 | console.log(“Hi World”);
11 | }
12 | reusableFunction();

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 :slightly_smiling_face:

your function needs the keyword function before its name
example:

function functionName() {
//do something;
}