2019年2月26日

摘要: https://www.jianshu.com/p/e375ba1cfc47 1. 语法:arr.reduce(callback,[initialValue]) reduce 为数组中的每一个元素依次执行回调函数,不包括数组中被删除或从未被赋值的元素,接受四个参数:初始值(或者上一次回调函数的返回值 阅读全文
posted @ 2019-02-26 14:45 namehou 阅读(165) 评论(0) 推荐(0)
 
摘要: ES6: http://es6.ruanyifeng.com/ x = > x * x 相当于 function(x){return x*x;} 箭头函数的两种格式 1.只包含一个表达式 ,连{ ... }和return都省略掉了 2.包含多条语句,这时候就不能省略{ ... }和return 两个 阅读全文
posted @ 2019-02-26 13:31 namehou 阅读(130) 评论(0) 推荐(0)
 
摘要: http://www.runoob.com/w3cnote/front-end-interview-a-few-important-points-of-knowledge.html <!-- 如何快速打乱一个数组 --> <script> var arr = [1,2,3,4,5,6,7,8,9]; 阅读全文
posted @ 2019-02-26 10:31 namehou 阅读(151) 评论(0) 推荐(0)