hi guys,what are my not getting right on this challenge??
**Your code so far**
// Only change code below this line
class Thermostat {
constructor(Fahrenheit) {
this._fahrenheit = fahrenheit;
}
get temprature() {
return C = 5/9 * (F - 32);
}
set temprature(celsius) {
this._celsius = (f = C * 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
thermos.temperature = 26;
temp = thermos.temperature; // 26 in Celsius
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
Challenge: Use getters and setters to Control Access to an Object
Based on your constructor, it looks like you have decided to store the temperature internally in Fahrenheit.
In the getter you need to convert that temp to Celsius and then return it. So your formula needs to use the variable you are storing the temperature in. This is the same variable you are using for storage in the constructor. Also, you don’t need to store the Celsius value in an actual variable, you can just return it.
For the setter, you are receiving a temp in C and need to convert it to F so you can store it using the internal storage variable you created in the constructor. So you definitely don’t want to be creating a new variable for this.
You have to paste your updated code in here, otherwise we won’t know what you tried and thus won’t know how to help you. Don’t forget to wrap it in triple backticks.