Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day April 7, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    What is printed to the console when the following program is run:

    function main() {
      let text = "";
    
      addGreeting(text, "Nice to meet you");
      addName(text, "Pascal");
      excite(text);
      console.log(text);
    }
    
    function addGreeting(message, greeting) {
      return message + greeting;
    }
    
    function addName(message, name) {
      return message + " " + name;
    }
    
    function excite(message) {
      return message + "!";
    }
    
    main();
    JavaScript