OK , so I have spent a few days trying to work through this and some it makes a little sense to me but honestly not too much… so I will put my code in here. and explain what it is that I think is going on… I just need someone to untangle the mess please… So here we are :
function makeClass() {
"use strict";
/* Alter code below this line */
class Thermostat { **// here I created ( or seemingly so) a class - but it does not pass that particular test..**
constructor (temperature){
this.tempurature=temperature;
} // I have taken the new Themostat and now assigned a property temperature to it (76)
get Thermostat(temperature){
return this.temperature =temperature; // Here we are getting the temperature(76) which feels nearly redundant in its logical statement to me.. but I digress..**
set Thermostat(temperature){
this.temperature=((temperature-32)*5/9 ; // conversion from Fahrenheit to Celsius and assignment to temperature
}
/* Alter code above this line */
return Thermostat;
}
const Thermostat = makeClass(); **// Thermostat is assigned to the function Make class ( where the Thermostat class is created**
const thermos = new Thermostat(76); // **setting in Fahrenheit scale a New Thermostat object created with the property that is the number 76 - which I am guessing is like saying**
**Thermostat { temperature: 76} ; ?**
let temp = thermos.temperature; // 24.44 in C // **Why do we have 2 different values being expressed here for the same expression please ?**
**Both are temp= thermos.temperature .. but they are both either 24.44 AND 26 ?**
thermos.temperature = 26;
temp = thermos.temperature; // 26 in C
As a Side note… absolutely none of the tests pass with this code so I am sure I am probably way off base here. OK the student is ready to put down the pen… and listen…
Thank you in advance for your wisdom…