摘要: 1、for循环遍历去重 2,、forEach遍历去重 3、Set 强制去重 阅读全文
posted @ 2020-04-12 18:10 strongerPian 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 1、forEach与map 2、filter 3、some与every 4、reduce//二维数组归并为一维数组 阅读全文
posted @ 2020-04-12 17:14 strongerPian 阅读(128) 评论(0) 推荐(0) 编辑
摘要: var arr = [3,5,,7,8,,,4] // 稀疏数组 // for循环遍历数组遇到空元素会输出undefined for (var i = 0; i < arr.length; i++) { console.log(i, arr[i]) } console.log(' ') // for 阅读全文
posted @ 2020-04-12 15:58 strongerPian 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-12 15:48 strongerPian 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 1、冒泡排序 2、选择排序 3、睡眠排序 阅读全文
posted @ 2020-04-12 00:08 strongerPian 阅读(240) 评论(0) 推荐(0) 编辑
摘要: concat/join/pop/push/shift/unshift/reverse/slice/splice/sort 阅读全文
posted @ 2020-04-12 00:05 strongerPian 阅读(191) 评论(0) 推荐(0) 编辑
摘要: var guoer = { name: 'yangguo', arxhz: function () { console.log('黯然销魂掌') } } console.log(guoer.name) console.log(guoer['name']) // name是属性名,这里加引号是固定写法 阅读全文
posted @ 2020-04-11 21:36 strongerPian 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 数组:一组数据(一个变量来承载) var str = "Hello world"; // 一个变量存放一个数据 var arr = [1,2,3,4,5,6,7,8,9]; //往数组结尾插入元素 arr[arr.length] = 20 数组有两种定义方式 var arr = []; //字面量的 阅读全文
posted @ 2020-04-09 14:11 strongerPian 阅读(121) 评论(0) 推荐(1) 编辑
摘要: 面向对象 类 定义属性和方法 对象 类的具体实现,继承了类所定义的属性和方法(是一种数据类型) 类是对象的抽象,对象是类的实例 js中的对象? js语言中一切皆为对象,比如数字、字符串、数组、Math、Object、函数 js中对象的本质:属性和方法的集合(无序,所以对象没有length属性) 用官 阅读全文
posted @ 2020-04-09 13:36 strongerPian 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 匿名函数:没有名字的函数 function () { console.log(123) } var test = function () { console.log(123) } div.onclick = function () { console.log(123) } 自调用函数(IIFE) I 阅读全文
posted @ 2020-04-09 13:32 strongerPian 阅读(142) 评论(0) 推荐(0) 编辑
返回顶端