freeCodeCamp Challenge Guide: Define a Constructor Function

Define a Constructor Function

MProblem Explanation

The Dog() function should be written in the exact same format as the Bird() function given in the example. Simply replace Bird with Dog to pass all test cases.


Solutions

Solution 1 (Click to Show/Hide)
function Dog() {
  (this.name = "Geogre"), (this.color = "White"), (this.numLegs = 4);
}