Merge pull request #13124 from Greenheart/fix/oop-dot-notation-log

fix(challenge): Accept more correct solutions for "OOP: Use dot notation"
This commit is contained in:
Peter Weinberg
2017-02-04 18:10:14 -05:00
committed by GitHub

View File

@ -85,8 +85,8 @@
""
],
"tests": [
"assert(code.match(/console\\.log\\(dog\\.name\\)/g), 'message: Your code should use a <code>console.log</code> statement to print the value for the <code>name</code> property of the <code>dog</code> object.');",
"assert(code.match(/console\\.log\\(dog\\.numLegs\\)/g), 'message: Your code should use a <code>console.log</code> statement to print the value for the <code>numLegs</code> property of the <code>dog</code> object.');"
"assert(/console.log\\(.*dog\\.name.*\\)/g.test(code), 'message: Your should use <code>console.log</code> to print the value for the <code>name</code> property of the <code>dog</code> object.');",
"assert(/console.log\\(.*dog\\.numLegs.*\\)/g.test(code), 'message: Your should use <code>console.log</code> to print the value for the <code>numLegs</code> property of the <code>dog</code> object.');"
],
"solutions": [
"let dog = {\n name: \"Spot\",\n numLegs: 4\n};\nconsole.log(dog.name);\nconsole.log(dog.numLegs);"