Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day March 24, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    Consider the following program:

    const MAX = 15;
    
    function main() {
        for (let i = 1; i <= MAX; i++) {
            if (i % 3 == 0) {
                console.log("Karel");
            } else if (i % 5 == 0) {
                console.log("Tracy");
            } else if (i % 3 == 0 && i % 5 == 0) {
                console.log("Karel and Tracy");
            }
        }
    }
    
    main();
    JavaScript

    What will be the last thing printed to the console?