Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
// Only change code below this line
class Thermostat{
constructor(newFahrenheit){
this.fahrenheit = newFahrenheit;
this.temperature = 5/9 * (newFahrenheit - 32);
}
// getter
get celsiusThemp() {
return this.temperature;
}
// setter
set celsiusThemp(newCelsius) {
this.temperature = newCelsius;
this.fahrenheit = newCelsius * 9.0 / 5 + 32;
}
}
// Only change code above this line
const thermos = new Thermostat(76); // Setting in Fahrenheit scale
let temp = thermos._temperature; // 24.44 in Celsius
console.log("temp1:"+temp);
thermos._temperature = 26;
temp = thermos._temperature; // 26 in Celsius
console.log("temp2:"+temp);
thermos.celsiusThemp = 25; // 26 in Celsius
console.log("temp3:"+thermos.celsiusThemp);
temp = thermos.celsiusThemp;
console.log("temp4:"+temp);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Challenge: Use getters and setters to Control Access to an Object
Link to the challenge: