![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6
久违i-i
放弃不难 但坚持很酷
展开
-
ES6数组方法
ES6中四个数组的使用方法: map(映射):可用于输出数组每一项的值 reduce(汇总):可用于数组的求和操作 filter(过滤器):得到数组中满足指定条件的项 forEach(循环迭代):实现数组的遍历操作 一、map的使用: 参数为: 数组的每一项 let arr=[12,13,14,15,16]; arr.map(item=>{ document.write(item); ...原创 2019-06-10 22:26:02 · 244 阅读 · 0 评论 -
ES6日期函数整理(常用)
年月日时分秒获取 一、得到日期的年 let date = new Date(); let year = date.getFullYear(); 二、得到日期的月 let month=date.getMonth()+1; // 拿到的 month 值一般是从0开始的,所以需要+1 三、得到日期的日(具体几号) let date = date.getDate(); 四、得到星期几 let da...原创 2019-08-12 11:14:59 · 8153 阅读 · 2 评论