Hi, I guess the tests for this challenge is not complete. It just tests for
-
class
keyword -
Thermostat
should be aclass
with a definedconstructor
method. -
Thermostat
can be instantiated.
so my simple code passed these tests which it should not. Please update this challenge’s tests.
My code is this
function makeClass() {
"use strict";
/* Alter code below this line */
class Thermostat{
constructor(temperature){
this.temperature = temperature;}
}
/* 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