Merge pull request #4880 from ltegman/fix/construct-javascript-objects-seed

Fix Construct Javascript Objects Seed
pull/4899/head
Rex Schrader 2015-12-01 19:32:58 -08:00
commit 116252917a
1 changed files with 4 additions and 7 deletions

View File

@ -69,9 +69,9 @@
"Have your <code>MotorBike</code> <code>constructor</code> describe an object with <code>wheels</code>, <code>engines</code> and <code>seats</code> properties and set them to numbers."
],
"tests":[
"assert(typeof (new MotorBike()).engines === 'number', 'message: <code>myMotorBike</code> should have a <code>engines</code> attribute set to a number.');",
"assert(typeof (new MotorBike()).wheels === 'number', 'message: <code>myMotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
"assert(typeof (new MotorBike()).seats === 'number', 'message: <code>myMotorBike</code> should have a <code>seats</code> attribute set to a number.');"
"assert(typeof (new MotorBike()).engines === 'number', 'message: <code>MotorBike</code> should have a <code>engines</code> attribute set to a number.');",
"assert(typeof (new MotorBike()).wheels === 'number', 'message: <code>MotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
"assert(typeof (new MotorBike()).seats === 'number', 'message: <code>MotorBike</code> should have a <code>seats</code> attribute set to a number.');"
],
"challengeSeed":[
"var Car = function() {",
@ -80,8 +80,6 @@
" this.seats = 1;",
"};",
"",
"var myCar = new Car();",
"",
"// Only change code below this line.",
"",
"var MotorBike = function() {",
@ -91,8 +89,7 @@
"};"
],
"tail":[
"var myMotorBike = new MotorBike();",
"(function() {return JSON.stringify(myMotorBike);})();"
"(function() {return JSON.stringify(new MotorBike());})();"
],
"solutions":[
"var Car = function() {\n this.wheels = 4;\n this.engines = 1;\n this.seats = 1;\n};\n\nvar myCar = new Car();\n\nvar MotorBike = function() {\n this.engines = 1;\n this.seats = 1;\n this.wheels = 4;\n};\n\nvar myMotorBike = new MotorBike();"