$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #21

What is the correct fix?

function greet(name) {
  return "Hi " + name;
}
greet("Sam")
console.log(result);
  1. Change + to , in the greeting string
  2. Store the return: const result = greet("Sam")
  3. Remove the return statement from greet
  4. Use console.log(greet) without calling
The result is never captured; assign the call to result.
Play Problem Solving ▸