From 2ddee563019b5c910e9bb8032b709e794e74dc14 Mon Sep 17 00:00:00 2001 From: Logan Tegman Date: Tue, 1 Dec 2015 15:40:31 -0800 Subject: [PATCH] Fix Construct Javascript Objects Seed --- .../object-oriented-and-functional-programming.json | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/seed/challenges/object-oriented-and-functional-programming.json b/seed/challenges/object-oriented-and-functional-programming.json index 151c64d933..77b0596a96 100644 --- a/seed/challenges/object-oriented-and-functional-programming.json +++ b/seed/challenges/object-oriented-and-functional-programming.json @@ -69,9 +69,9 @@ "Have your MotorBike constructor describe an object with wheels, engines and seats properties and set them to numbers." ], "tests":[ - "assert(typeof (new MotorBike()).engines === 'number', 'message: myMotorBike should have a engines attribute set to a number.');", - "assert(typeof (new MotorBike()).wheels === 'number', 'message: myMotorBike should have a wheels attribute set to a number.');", - "assert(typeof (new MotorBike()).seats === 'number', 'message: myMotorBike should have a seats attribute set to a number.');" + "assert(typeof (new MotorBike()).engines === 'number', 'message: MotorBike should have a engines attribute set to a number.');", + "assert(typeof (new MotorBike()).wheels === 'number', 'message: MotorBike should have a wheels attribute set to a number.');", + "assert(typeof (new MotorBike()).seats === 'number', 'message: MotorBike should have a seats 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();"