diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json index a1ff7a9cf5..6e96a6fb59 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/object-oriented-programming.json @@ -648,7 +648,7 @@ "This becomes tedious after more than a few properties.", "
Bird.prototype.eat = function() {", "A more efficient way is to set the
console.log(\"nom nom nom\");
}
Bird.prototype.describe = function() {
console.log(\"My name is \" + this.name);
}
prototype
to a new object that already contains the properties. This way, the properties are added all at once:",
- "Bird.prototype = {", + "
numLegs: 2,
eat: function() {
console.log(\"nom nom nom\");
},
describe = function() {
console.log(\"My name is \" + this.name);
}
};
Bird.prototype = {", "
numLegs: 2,
eat: function() {
console.log(\"nom nom nom\");
},
describe: function() {
console.log(\"My name is \" + this.name);
}
};
numLegs
, eat
, and describe
to the prototype
of Dog
by setting the prototype
to a new object. The properties can be set to any values."
],