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

Which fix removes the bug?

function greet(name) {
  return 'Hi ' + name;
}
console.log(greet());
  1. Give name a default value
  2. Rename the function param
  3. Return a template literal
  4. Declare greet with const
A missing argument is undefined, which concatenates into the literal text 'Hi undefined'.
Play Problem Solving ▸