上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 1.每一个函数都有一个显示原型prototype 2.每一个实例对象都有一个隐示原型--proto-- 实例对象的隐示原型等于构造函数的显示原型 3 原型链(隐示原型链) 答: 当你访问实例对象的属性时,会先从本身去找,没有则去原型上去找,还没有则去原型对象的--proto--去找,找到最上面--p 阅读全文
posted @ 2022-05-04 21:43 小白张先生 阅读(37) 评论(0) 推荐(0)
摘要: let arr = [2, 4, 3, 6, 5] // 冒泡排序 function sort (arr) { for (let i = 0; i < arr.length; i++) { for (let j = 0; j< arr.length - 1 - i; j++) { if (arr[j 阅读全文
posted @ 2022-05-04 21:12 小白张先生 阅读(37) 评论(0) 推荐(0)
摘要: export function findComponentDownward (context, componentName) { const childrens = context.$children; let children = null; if (childrens.length) { for 阅读全文
posted @ 2022-04-25 21:43 小白张先生 阅读(37) 评论(0) 推荐(0)
摘要: let obj = { job: { address: 'shenzhen', salary: '20k' }, name: 'zhang', age: 22 } // 第一种(函数和正则不可以) // let obj1 = JSON.parse(JSON.stringify(obj)) // ob 阅读全文
posted @ 2022-04-24 22:22 小白张先生 阅读(115) 评论(0) 推荐(0)
摘要: function f1 (url) { return new Promise(resolve => { resolve(url) }) } function maxPromiseLimit (arr, max, callback) { // 如果没有传入arr或max则不继续执行 if (!arr 阅读全文
posted @ 2022-04-21 22:33 小白张先生 阅读(95) 评论(0) 推荐(0)
摘要: function Promise (excutor) { this.promiseState = 'pending' this.promiseResult = null let self = this this.callbacks = [] function resolve (data) { if( 阅读全文
posted @ 2022-04-21 22:01 小白张先生 阅读(51) 评论(0) 推荐(0)
摘要: 1.这个函数中包含多个对象,尽管这个函数是被最外层的对象所调用,this指向的也只是它上一级的对象 let obj = { a: 10, b: { a: 20, fn: function () { console.log(this); //this指上一级的调用,this指向b console.lo 阅读全文
posted @ 2022-04-03 16:57 小白张先生 阅读(25) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-03 16:37 小白张先生 阅读(21) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-03 16:22 小白张先生 阅读(16) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2022-04-03 10:30 小白张先生 阅读(69) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页