Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day Feb. 27, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    In the following program, what will print when a graphic rectangle on a canvas is clicked?

    function main() {
        mouseClickMethod(mysteryPrint);
    }
    
    function mysteryPrint(e) {
        console.log(e.getX() + " " + e.getY());
    }
    
    // Assume there is additional code that creates at least one graphic rectangle
    
    main();
    JavaScript