These are used at different times. Initially, when Thermostat object is created it takes the temperature in Fahrenheit. For changing temperature after that, setter will be used:
const thermos = new Thermostat(76); // initial temperature
thermos.temperature = 26; // changing temperature uses setter and Celsius
sorry Iām just not understanding the flow of this code. If time passes what temp is changed first? Does the user input a different temp in celcius and the function internally converts to fahrenheit to update the object.
Exactly this. The only way to change the internal temperature is to use the setter, which will make sure the saved temperature will be in correct units.