I’ m just trying to se what’s still wrong with this code.
**My code so far**
// Only change code below this line
class Thermostat {
constructor(fahrenheit){
this.fahrenheit=fahrenheit;
}
}
get temperature() {
return 5/9*(this.fahrenheit - 32);
}
set temperature(celsius){
5/9*(this.fahrenheit - 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 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Challenge: Use getters and setters to Control Access to an Object
You should only internally store the temperature in one way. Pick either Celsius or Fahrenheit. The getter/setter makes sure that the user gets/sets everything in Celsius no matter how you store it internally (after using Fahrenheit in the constructor)