Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day April 3, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    Consider the following program:

    function main() {
        asterisk(3);
        asterisk(5);
    }
    function asterisk(num) {
      let result = "";
    
      while (num > 0) {
        result += "*";
        num--;
      }
    
      console.log(result);
    }
    
    main();
    JavaScript

    What will be the output of the program?