Basic JavaScript - Write Reusable JavaScript with Functions

Tell us what’s happening:
i need to call reusableFunction once it is defined
I dont understand

Your code so far

function reusableFunction(){
  let str = "Hi World";
  console.log(str);
}


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Write Reusable JavaScript with Functions

Link to the challenge:

You need to call the function.

For example if we have function like the below:

function sayHello() {
  const hello = "Hello World!";
  console.log(hello);
}

You can call it like the below:

sayHello()

Happy coding!

Hello!

I followed the example provided with the instructions. I never did anything different than the example, except placing the required function name and the text.

function functionName() {
  console.log("Hello World");
}

Remember to call it after following the example, though. I was stuck on that for a short time.

Happy coding!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.