Javascript recap creating a simple thermostat