Merge pull request #12958 from padulam/fix/change-the-prototype-instructions
Fix error in instructions for change the prototype to a new object challenge
This commit is contained in:
@ -648,7 +648,7 @@
|
|||||||
"This becomes tedious after more than a few properties.",
|
"This becomes tedious after more than a few properties.",
|
||||||
"<blockquote>Bird.prototype.eat = function() {<br> console.log(\"nom nom nom\");<br>}<br><br>Bird.prototype.describe = function() {<br> console.log(\"My name is \" + this.name);<br>}</blockquote>",
|
"<blockquote>Bird.prototype.eat = function() {<br> console.log(\"nom nom nom\");<br>}<br><br>Bird.prototype.describe = function() {<br> console.log(\"My name is \" + this.name);<br>}</blockquote>",
|
||||||
"A more efficient way is to set the <code>prototype</code> to a new object that already contains the properties. This way, the properties are added all at once:",
|
"A more efficient way is to set the <code>prototype</code> to a new object that already contains the properties. This way, the properties are added all at once:",
|
||||||
"<blockquote>Bird.prototype = {<br> numLegs: 2, <br> eat: function() {<br> console.log(\"nom nom nom\");<br> },<br> describe = function() {<br> console.log(\"My name is \" + this.name);<br> }<br>};</blockquote>",
|
"<blockquote>Bird.prototype = {<br> numLegs: 2, <br> eat: function() {<br> console.log(\"nom nom nom\");<br> },<br> describe: function() {<br> console.log(\"My name is \" + this.name);<br> }<br>};</blockquote>",
|
||||||
"<hr>",
|
"<hr>",
|
||||||
"Add three properties <code>numLegs</code>, <code>eat</code>, and <code>describe</code> to the <code>prototype</code> of <code>Dog</code> by setting the <code>prototype</code> to a new object. The properties can be set to any values."
|
"Add three properties <code>numLegs</code>, <code>eat</code>, and <code>describe</code> to the <code>prototype</code> of <code>Dog</code> by setting the <code>prototype</code> to a new object. The properties can be set to any values."
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user