We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
投影片 擴展運算符 -> https://hackmd.io/p/S1Jll4LH#/2/6 剩餘運算符 -> https://hackmd.io/p/HJcb_nKf#/1/5
The text was updated successfully, but these errors were encountered:
可以搭配一下這篇文章服用 http://cookfront.github.io/2015/06/06/es6-function/
Sorry, something went wrong.
簡單說 rest 就是把參數變成陣列 spread 是把陣列變成參數 可以這樣說嗎?
rest
spread
allen.hsieh : 關於 Rest Parameter,我的理解如下:用於 function 承接參數,由於 js 在函式定義與實際呼叫時,參數傳遞個數可以不同,故要取得非事先定義好的參數必須透過下列兩種方式 (1) 透過 arguments 物件 (2) ES6 可以透過 Rest Parameter
rest 的好處: (1) rest 是承接剩下尚未定義的參數,arguments object 則是所有實際傳遞的參數都放進去,要取剩餘的部分,要自己截取 (2) arguments object 是 array-like 物件, rest 是 array 物件, 所以 rest 不用轉型就可以使用 sort, map, forEach 等 functions.
rayway30419
rest 是 array 物件, 所以 rest 不用轉型就可以使用 sort, map, forEach 等 functions. 這點很棒
allen.hsieh : 至於 Spread Operator,可以想像成容器,在函式可以代表多個參數,在陣列可以代表多個元素,在解構時可以代表多個變數。
No branches or pull requests
投影片
擴展運算符 -> https://hackmd.io/p/S1Jll4LH#/2/6
剩餘運算符 -> https://hackmd.io/p/HJcb_nKf#/1/5
The text was updated successfully, but these errors were encountered: