Tell us what’s happening:
Describe your issue in detail here.
I can’t seems to meet all set objectives on the getter and setter tasks even after having written the needed code which works just the way it is supposed to, this segment is really taking my time as i keep getting knocked off for not getting objectives 4 to 6 all inclusive successfully done. I really need a hand here.
**Your code so far**
// Only change code below this line
class Thermostat {
constructor(temperature){
this.temperature = temperature;
}
get tempvalue(){
return 5/9 * (this.temperature - 32);
}
set tempvalue(newValue){
this.temperature = (newValue * 9.0) / 5 + 32;
}
}
// Only change code above this line
const thermos = new Thermostat(76); // Setting in Fahrenheit scale
console.log(thermos.temperature);
let temp = thermos.temperature; // 24.44 in Celsius
let celvalue = thermos.tempvalue;
console.log(celvalue)
thermos.temperature = 26;
temp = thermos.temperature; // 26 in Celsius
thermos.tempvalue = 0;
console.log(thermos.temperature);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43
Challenge: Use getters and setters to Control Access to an Object
Link to the challenge: