fix/ownProps (#41686)

related issue:#4114
This commit is contained in:
Rafael D. Hernandez
2021-03-31 01:18:37 -07:00
committed by GitHub
parent e1ea77412b
commit 37e8d0b757

View File

@ -8,7 +8,7 @@ dashedName: iterate-over-all-properties
# --description--
You have now seen two kinds of properties: `own` properties and `prototype` properties. `Own` properties are defined directly on the object instance itself. And `prototype` properties are defined on the `prototype`.
You have now seen two kinds of properties: <dfn>own properties</dfn> and `prototype` properties. Own properties are defined directly on the object instance itself. And `prototype` properties are defined on the `prototype`.
```js
function Bird(name) {
@ -20,7 +20,7 @@ Bird.prototype.numLegs = 2; // prototype property
let duck = new Bird("Donald");
```
Here is how you add `duck`'s `own` properties to the array `ownProps` and `prototype` properties to the array `prototypeProps`:
Here is how you add `duck`'s own properties to the array `ownProps` and `prototype` properties to the array `prototypeProps`:
```js
let ownProps = [];
@ -42,7 +42,7 @@ console.log(prototypeProps);
# --instructions--
Add all of the `own` properties of `beagle` to the array `ownProps`. Add all of the `prototype` properties of `Dog` to the array `prototypeProps`.
Add all of the own properties of `beagle` to the array `ownProps`. Add all of the `prototype` properties of `Dog` to the array `prototypeProps`.
# --hints--