随笔分类 -  js 梳理

摘要:实用场景 一(处理类数组 如 arguments ) 阅读全文
posted @ 2018-04-08 13:32 杉VS冉 阅读(167) 评论(1) 推荐(0)
摘要:// 深拷贝 // 判断类型 console.log(checkType(1)); //[object Number] console.log(checkType('1')); //[object String] console.log(checkType(true)); //[object Boo 阅读全文
posted @ 2018-04-08 13:17 杉VS冉 阅读(299) 评论(2) 推荐(0)
摘要://实用场景一(数组去重)注意:先排序 var arr = [1, 2, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 8, 8, 9, 9]; var result = arr.sort().reduce((init, current) => { if (init.length 0 阅读全文
posted @ 2018-04-08 11:43 杉VS冉 阅读(234) 评论(0) 推荐(0)