It’s pretty straightforward, they do what they claim to do…
This line calls the getter method, which does nothing but return the current temperature (converted to Celsius):
let temp = thermos.temperature; // 24.44 in Celsius
This line calls the setter method, which takes in a temperature (in Celsius) as argument, and sets the current temperature to its respective value in Fahrenheit:
This two line should be enough in telling you that is actually working.
You are passing 76 as a value but getting 24.44 back.
If you actually console it:
const thermos = new Thermostat(76);
console.log(thermos)
// Thermostat { f: 76 }
// temperatureis correctly initialized as 76
// but when I actually get it
console.log(thermos.temperature);
// 24.44
So I’d say it’s working: it’s converting from 76F to 24C without me explicitly telling it to do so: as the user of your class I’m not calling some method to convertToCelsius(), you are doing it for me
but when i console.log for thermos it is returning 78.8 and for thermos.temperature it is returning 84.4
dont know where are these values coming from
i didnt changed any value