I have been stuck on this challenge for the past few days. I am able to convert the temperature from Fahrenheit to Celsius but not the other way around. Please help me complete the challenge.
**Your code so far**
// Only change code below this line
class Thermostat {
constructor(farenheit) {
this._temperature = farenheit
}
get temperature() {
return this._temperature
}
set temperature(tempF) {
this._temperature = 5/9 * (tempF - 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(temp)
thermos.temperature = 70;
temp = thermos.temperature; // 26 in Celsius
console.log(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.67 Safari/537.36
Challenge: Use getters and setters to Control Access to an Object
Link to the challenge: