摘要: 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)