---
title: Define a Constructor Function
localeTitle: 定义构造函数
---
## 定义构造函数

### 方法：

`Dog()`函数应该以与示例中给出的`Bird()`函数完全相同的格式编写。只需将`Bird` with `Dog`替换为通过所有测试用例。

### 解：

```javascript
function Dog() { 
  this.name = "Geogre", 
  this.color = "White", 
  this.numLegs = 4; 
 } 

```