From b8b86a65b809b795000a2d629d61735387e439d8 Mon Sep 17 00:00:00 2001 From: Jeremy L Thompson Date: Thu, 14 Oct 2021 07:58:13 -0600 Subject: [PATCH] fix issue #42850, test for setters adding properties (#43813) --- .../make-a-person.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.md index a01f7a9f92..e8b226f8d8 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.md @@ -23,10 +23,19 @@ Run the tests to see the expected output for each method. The methods that take # --hints-- -`Object.keys(bob).length` should return 6. +No properties should be added. `Object.keys(bob).length` should always return 6. ```js -assert.deepEqual(Object.keys(bob).length, 6); +assert.strictEqual( + Object.keys((function () { + let bob = new Person('Bob Ross'); + bob.setFirstName('Haskell'); + bob.setLastName('Curry'); + bob.setFullName('John Smith'); + return bob; + })()).length, + 6 + ); ``` `bob instanceof Person` should return `true`.