What was wrong?

Tell us what’s happening:

**Your code so far**

// Only change code below this line

// Only change code above this line

class Thermostat{

    this._temperature = temperature;

get temperature(){
    return this._temperature

set temperature(value){

    this._temperature = value



const thermos = new Thermostat(24.44); // 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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36.

Challenge: Use getters and setters to Control Access to an Object

Link to the challenge:

The aim is that the constructor takes a temperature in Fahrenheit and the getter returns a temperature in Celsius. You’re just returning whatever gets put in

1 Like

thank you! I found out its answer