04 2022 档案
摘要:export function findComponentDownward (context, componentName) { const childrens = context.$children; let children = null; if (childrens.length) { for
阅读全文
摘要:let obj = { job: { address: 'shenzhen', salary: '20k' }, name: 'zhang', age: 22 } // 第一种(函数和正则不可以) // let obj1 = JSON.parse(JSON.stringify(obj)) // ob
阅读全文
摘要:function f1 (url) { return new Promise(resolve => { resolve(url) }) } function maxPromiseLimit (arr, max, callback) { // 如果没有传入arr或max则不继续执行 if (!arr
阅读全文
摘要:function Promise (excutor) { this.promiseState = 'pending' this.promiseResult = null let self = this this.callbacks = [] function resolve (data) { if(
阅读全文
摘要:1.这个函数中包含多个对象,尽管这个函数是被最外层的对象所调用,this指向的也只是它上一级的对象 let obj = { a: 10, b: { a: 20, fn: function () { console.log(this); //this指上一级的调用,this指向b console.lo
阅读全文
摘要:let arr = [1,2,2,3,4,2,5,7,1,4,2,5,6,3,7,3,5,4,3,] // 第一种 双重for和splice截取 // function unique (arr) { // for(let i = 0; i<arr.length;i++){ // for(let j
阅读全文