--- id: 587d7b8c367417b2b2512b54 title: Use getters and setters to Control Access to an Object challengeType: 1 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(typeof Thermostat === "function" && typeof Thermostat.constructor === "function","Thermostat should be a class with a defined constructor method.");' - text: '' testString: 'getUserInput => assert(getUserInput("index").match(/class/g),"class keyword was used.");' - text: '' testString: 'assert(() => {const t = new Thermostat(32); return typeof t === "object" && t.temperature === 0;}, "Thermostat can be instantiated.");' ```
## Challenge Seed
```js function makeClass() { "use strict"; /* Alter code below this line */ /* 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 ```
## Solution
```js // solution required ```