JS bind & apply/call
摘要:### bind ``` let boundFunc = func.bind(context); ``` - 将func的context修改为传入的参数,返回一个新的func函数 ### call ``` func.call(context, arg1, arg2, ...) ``` ### app
阅读全文
JS setInterval
摘要:### 用法 - 第一个参数是传入的函数 - 第二个参数是 间隔的以毫秒为单位的时间 - 后面的是一系列的参数 - handler之外的参数直接不传 ``` setInterval((...args)=>{ args.forEach(val=>{ console.log(val) }) }, 100
阅读全文