Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

JavaScript Question of the Day May 14, 2025

  1. Incorrect Correct No Answer was selected Invalid Answer

    An automated toaster is running the following code, which has it turn on and toast bread if there is bread in the machine and the hour is 9am. However, it is not running as expected – the toaster always runs when there is bread in the machine.

    let breadInMachine = true;
    let hour = 9;
    
    if (breadInMachine || hour == 9) {
      // Code to toast bread
    }
    JavaScript

    Choose the option below that will fix the program so that it runs as expected.