Skip to content

Commit f4dcf29

Browse files
committed
resolve ganqqwerty#78
1 parent c04040b commit f4dcf29

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,16 +1864,15 @@ Object.keys(person); // ['name', 'salary', 'country']
18641864
```
18651865
In the example above `phoneNo` property didn't show up because we made it non-enumerable by setting **enumerable:false**
18661866
1867+
**Bonus**
1868+
18671869
Now let's try to change value of `phoneNo`
18681870
18691871
```javascript
18701872
person.phoneNo = '7777777777';
18711873
```
1872-
Changing non-enumerable property value will return error in `strict mode`. In non-strict mode it won't through any error but it won't change the value of phoneNo.
1873-
1874-
**Bonus**
18751874
1876-
**Object.defineProperty()** is also let you create read-only properties as we saw above, we are not able to modify phoneNo value of a person object.
1875+
**Object.defineProperty()** also lets you create read-only properties as we saw above, we are not able to modify phoneNo value of a person object. This is because descriptor has **writable** property, which is `false` by default. Changing non-writable property value will return error in strict mode. In non-strict mode it won't through any error but it won't change the value of phoneNo.
18771876
18781877
## Question 50. What is Function binding ?
18791878

0 commit comments

Comments
 (0)