在閱讀 《JavaScript 框架設計》 2rd 中,有一段代碼不甚明了,煩請各位指教,以下是代碼:var bind = function(bind) { return { bind: bind.bind(bind), call: bind.bind(bind.call), apply: bind.bind(bind.apply) }}(Function.prototype.bind)var a = [1, [2, 3], 4], b = [5, 6]var concat = bind.apply([].concat)console.log(concat(b, a)) // [5, 6, 1, 2, 3, 4]該段代碼在原書的49頁
對于 js 中 bind 的理解
函數式編程
2019-03-14 18:12:11