mcrosby114

年加入本站
mcrosby114

最近在 Docs 的活動

檢視所有活動
頁面 日期 回應

Rest parameters


Technically we're referring to the formal parameter of a function in its declaration -- not the argument. The argument is not what gets prefixed with "...". An argument is merely what the caller supplies and what gets assigned to the parameter.

Spread syntax


In the example illustrating how you can't mimic Object.assign(..), the actual output differs from the comments. Also, would this not mimic Object.assign(): const merge = ( ...objects ) => objects.reduce( (obj, merged) => ( { ...obj, ...merged } ), { } );

Spread syntax