[].slice.call
生活随笔
收集整理的這篇文章主要介紹了
[].slice.call
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
緣由
- 起源于《es6標準入門》數組的擴展中[].slice.call(arrayLike)
原理分析
- slice底層實現就是使用循環實現的
slice規格
- 從js規格看原理
- slice規格鏈接
摘錄備注三
The slice function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method. 復制代碼- 意思就是,slice這樣實現是有意為之,考慮的就是它的擴展性和通用性,我們可以有意的進行擴展和轉移
轉載于:https://juejin.im/post/5cd3f78bf265da03b91832a2
總結
以上是生活随笔為你收集整理的[].slice.call的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c# Sockect 通信
- 下一篇: Bind view的master与sla