mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
docs(object): fix object.assign
This commit is contained in:
parent
d7f742af69
commit
d4ae227730
@ -326,7 +326,7 @@ Object.assign(target, source1, source2);
|
||||
target // {a:1, b:2, c:3}
|
||||
```
|
||||
|
||||
`Object.assign`方法的第一个参数是目标对象,后面的参数都是源对象。只要有一个参数不是对象,就会抛出TypeError错误。
|
||||
`Object.assign`方法的第一个参数是目标对象,后面的参数都是源对象。
|
||||
|
||||
注意,如果目标对象与源对象有同名属性,或多个源对象有同名属性,则后面的属性会覆盖前面的属性。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user