Getter, Setter challenge giving unclear tests failed

Tell us what’s happening:
The tests that are not passing are:

  • When instantiated with a Fahrenheit value, `Thermostat` should set the correct `temperature` .
  • A `getter` should be defined
  • A `setter` should be defined.
These tests are not very clear to me. Please help me identify my mistake here.
**Code**

// Only change code below this line
class Thermostat{
  constructor(temperature){
    this._temperature=5/9*(temperature-32);
  }
  //getter
  get getter1(){
    return this._temperature;
  }
  //setter
  set setter1(up){
    this._temperature=up;
  }
}
// Only change code above this line

**Your browser information: Mozilla Firefox**

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0.

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

Link to the challenge:

These names do not match the instructions. Your getter and setter must be for the temperature.

Thanks for the clarification. It solved my issue. :grinning: :grinning:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.