Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day May 30, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    What value does the program output?

    function main() {
      let a = 4;
      a = check(a);
      a = check(a);
      console.log(a);
    }
    
    function check(n) {
      if (n > 10) {
        return n - 5;
      } else if (n > 5) {
        return n + 5;
      } else {
        return n * 2;
      }
    }
    
    main();
    JavaScript