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