摘要:
1:异步操作(自己写回调来传入) 1 function requestData(url, successCallback, failureCallback) { 2 setTimeout(() => { 3 if (url "http://www.baidu.com") { 4 console.lo 阅读全文
posted @ 2022-03-30 21:22
沁霓
阅读(51)
评论(0)
推荐(0)
摘要:
1:响应式函数的封装 1 //封装一个函数的响应式 2 //用数组来保存需要响应的函数 3 const reactiveFns = [] 4 //在watchFn里面的函数都会被监视 5 function watchFn(fn) { 6 reactiveFns.push(fn) 7 } 8 //对象 阅读全文
posted @ 2022-03-30 19:55
沁霓
阅读(89)
评论(0)
推荐(0)
摘要:
1:在ES7之前判断数组里面是否有一个方法我们需要使用indexof ES7可以使用 includes 1 const arr = ['a', 12] 2 console.log(arr.includes(12)); 3 console.log(arr.indexOf(14)); 2:乘方运算 ** 阅读全文
posted @ 2022-03-30 09:54
沁霓
阅读(96)
评论(0)
推荐(0)

浙公网安备 33010602011771号