I am completely lost. I was 100% on top of everything discussed before the “Use class Syntax to Define a Constructor Function” lesson. That lesson all of a sudden introduced class, constructor, this, and new without actually explaining what they are or how they work/relate to anything previously discussed. Still, I was able to brute force my way through that challenge by basically just copying the example code. Then I got to this lesson (the one immediately after) and it still doesn’t explain what any of this stuff is or how it works? It explains what getters/setters are and how their associated syntax but I still don’t even know what “this.” means or what a constructor or class is.
I’ve tried googling each of the terms but I can’t understand any of the explanations anywhere else because they use terminology that fCC hasn’t introduced me to yet. I’m starting to feel like beginning with fCC has siloed me off from other resources by withholding information I need to figure out things that it isn’t telling me.
I really hope someone can help me out with this.
Your code so far
// Only change code below this line
// 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; rv:109.0) Gecko/20100101 Firefox/112.0
Challenge: ES6 - Use getters and setters to Control Access to an Object
Link to the challenge: