diff --git a/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json b/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json index 23345f8d66..c1687c2a61 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json +++ b/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json @@ -337,7 +337,8 @@ "" ], "tests": [ - "assert(ownProps.includes('name') && ownProps.includes('numLegs'), 'message: ownProps should include the values \"numLegs\" and \"name\".');" + "assert(ownProps.includes('name') && ownProps.includes('numLegs'), 'message: ownProps should include the values \"numLegs\" and \"name\".');", + "assert(!/\\Object.keys/.test(code), 'message: Solve this challenge without using the built in method Object.keys().');" ], "solutions": [ "function Bird(name) {\n this.name = name;\n this.numLegs = 2;\n}\n\nlet canary = new Bird(\"Tweety\");\nfunction getOwnProps (obj) {\n const props = [];\n \n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n props.push(prop);\n }\n }\n \n return props;\n}\n\nconst ownProps = getOwnProps(canary);"