ES6: Getter/Setter challenge

Ive been working this challenge for the better part of an hour, its time i ask for help or how people approached the solution…

What have you tried? What isn’t working as you expect?

Well ive been very confused for a long time now, but after taking a break i tried again with this code

How can i get the test case Instantiated to pass?

@tommygebru Instead of posting screenshots, can you post the actual code from the editor into the reply? I helps those trying to help you to test your code and offer suggestions faster. Basically, we do not have to retype your code.

Thank you.

If I initiate a new instance of Thermostat with the value Fahrenheit value of 32 like below:

const t = new Thermostat(32);
console.log(t.temperature); // should display 0 but your solution displays 32

then I expect t.temperature to return ‘0’. Unfortunately, yours just returns the same value (32) that you initialize it with. Why? Because your constructor assigns the value passed to it (32) to a property named _fahrenheit and your getter just returns value of _fahrenheit.

sorry im back, i think this is what i had in the screenshot

/* Alter code below this line */
class Thermostat{
        this._fahrenheit = fahrenheit;
    get temperature(){
        this._fahrenheit = fahrenheit * 9.0 / 5 + 32;
    set temperature(celsius){
        //this._fahrenheit = console.log("trying to get celsius");
      this._fahrenheit = 5/9 * (celsius-32)
/* Alter code above this line */

const thermos = new Thermostat(32); // setting in Fahrenheit scale

//let temp = thermos.temperature; // 24.44 in C
//thermos.temperature = 26;
//temp = thermos.temperature; // 26 in C

You reference a variable named fahrenheit above, but there is no such variable within the scope of your getter method.