Tell us what’s happening:
The code that I wrote below passed the challenge, but I am not sure why. I checked it before finishing just to make sure I satisfied the constructor, but never put in a getter or setter. It passed just after putting in the constructor.
Thanks!
Your code so far
function makeClass() {
"use strict";
/* Alter code below this line */
class Thermostat{
constructor(temp){
this._temp = temp;
}
}
/* Alter code above this line */
return Thermostat;
}
const Thermostat = makeClass();
const thermos = new Thermostat(76); // setting in Fahrenheit scale
let temp = thermos.temperature; // 24.44 in C
thermos.temperature = 26;
temp = thermos.temperature; // 26 in C
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.
Yea, the tests don’t actually test anything, there have been multiple issues submitted to get it fixed but for now it is what it is, the tests will not actually test the solution.
Hello - I just found the same thing - it didn’t matter if the setter and getter were properly named, there were no errors when the results didn’t match but it ended up passing the tests, perhaps just checking that those few necessary conditions are correct. Definitely some problems with it! Or at least with the description of the temperature conversion formulas, it seems that a little more was expected.