diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md index 45fdd88cd3..b739dc25dc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md @@ -38,7 +38,7 @@ tests: - text: class keyword was used. testString: getUserInput => assert(getUserInput('index').match(/class/g),'class keyword was used.'); - text: Thermostat can be instantiated. - testString: assert(() => {const t = new Thermostat(32); return typeof t === 'object' && t.temperature === 0;}, 'Thermostat can be instantiated.'); + testString: assert((() => {const t = new Thermostat(32);return typeof t === 'object' && t.temperature === 0;})(), 'Thermostat can be instantiated.'); ``` @@ -75,17 +75,17 @@ temp = thermos.temperature; // 26 in C ```js function makeClass() { - "use strict"; + 'use strict'; /* Alter code below this line */ class Thermostat { - constructor(fahrenheit) { - this._tempInCelsius = 5/9 * (fahrenheit - 32); + constructor(temperature) { + this._temperature = (5 / 9) * (temperature - 32); } - get tempInCelsius(){ - return _tempInCelsius; + get temperature() { + return this._temperature; } - set tempInCelsius(newTemp){ - this._tempInCelsius = newTemp; + set temperature(temperature) { + this._temperature = temperature; } } /* Alter code above this line */