Not sure how celcius is not defined

I’m getting ReferenceError: celsius is not defined when I run the tests. However I’m not sure how this is possible, and what makes it different from the code in the guide for this challenge?

   **Your 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 (celcius){
 this.fahrenheit = (celsius * 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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 OPR/76.0.4017.208

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

Link to the challenge:

You spelled it two different ways.

I am blind. Thank you for your time

the software development process: I can't fix this. Crisis of confidence. Question career. Question life. Oh it was a type, cool.

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