Skip to content

Commit a9d16bc

Browse files
committed
fix typo and update link
1 parent 0e5b449 commit a9d16bc

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

14 - JavaScript References VS Copying/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@
107107
利用 JSON 可以先将对象转成字符串的格式,然后再把它转成 JSON,从而实现复制。
108108

109109
```js
110-
const wes = {
111-
name: 'Wes',
112-
age: 100,
113-
social: {
114-
twitter: '@wesbos',
115-
facebook: 'wesbos.developer'
116-
}
117-
};
118-
119-
const dev = Object.assign({}, wes);
120-
const dev2 = JSON.parse(JSON.stringify(wes));
121-
console.log(wes);
122-
console.log(dev);
123-
console.log(dev2);
110+
const wes = {
111+
name: 'Wes',
112+
age: 100,
113+
social: {
114+
twitter: '@wesbos',
115+
facebook: 'wesbos.developer'
116+
}
117+
};
118+
119+
const dev = Object.assign({}, wes);
120+
const dev2 = JSON.parse(JSON.stringify(wes));
121+
console.log(wes);
122+
console.log(dev);
123+
console.log(dev2);
124124
```
125125

126126
最后需要注意的是:在前面的例子里面,我们用的数组和对象都只是一层嵌套,Lodash 有一个深度复制的方法,但你使用之前需要多考虑一下。

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ JavaScirpt30 是 Wes Bos 推出的一个 30 天挑战。项目免费提供了 30
5151
11. [x] [Custom Video Player 指南](https://github.com/soyaine/JavaScript30/blob/master/11%20-%20Custom%20Video%20Player/README.md)
5252
12. [x] [Key Sequence Detection 指南](https://github.com/soyaine/JavaScript30/tree/master/12%20-%20Key%20Sequence%20Detection/README.md) | [在线效果](http://soyaine.cn/JavaScript30/12%20-%20Key%20Sequence%20Detection/index-FINISHED.html)
5353
13. [x] [Slide in on Scroll 指南](https://github.com/soyaine/JavaScript30/blob/master/13%20-%20Slide%20in%20on%20Scroll/README.md) | [图片随屏幕滚动而滑入滑出的在线效果](http://soyaine.cn/JavaScript30/13%20-%20Slide%20in%20on%20Scroll/index-SOYAINE.html)
54-
14. [ ] JavaScript References vs. Copying
54+
14. [x] [JavaScript References vs. Copying 指南](https://github.com/soyaine/JavaScript30/tree/master/14%20-%20JavaScript%20References%20VS%20Copying)
5555
15. [ ] LocalStorage
5656
16. [ ] Mouse Move Shadow
5757
17. [ ] Sort Without Articles

0 commit comments

Comments
 (0)