Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day March 11, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    Consider The following program:

    function main() {
        keyDownMethod(animate);
    }
    
    function animate(e) {
        ball.move(5, 5);
    }
    
    main();
    JavaScript

    How can we set up animate so that it will only move the ball if the letter ‘j’ is pressed down?