![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
ballyyang
这个作者很懒,什么都没留下…
展开
-
ie11中使用es7的includes
公司前端项目用的是Angular6,最近在项目中用到了es7中数组的新特性includes,在谷歌浏览器正常运行,在IE浏览器运行的时候报错,识别不了includes。一开始的想法就是用indexOf代替一下,转念一想,是否可以做一个兼容,于是自己写了个polyfills,兼容如下: 同时支持String和Array: // 兼容es7 includes string Array (func...原创 2018-11-07 19:56:49 · 3006 阅读 · 1 评论 -
268. Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5,7,0,1] O...原创 2018-11-13 23:01:33 · 94 阅读 · 0 评论 -
根据不同种类进行归类
最近在项目中用nodejs写了一个合同模板的功能,实现了可配置化,让不同公司适用不同的合同模板。 想到之前做了一个月度统计报表,对相同月份的数据进行统计,举个例子如下 有一个数组,每条数据记录了各自同学的名字,所属公司,所拥有的现金,所在的月份 const staffs = [ { staff: '小黄', company: '深圳公司', cash: 300, month: '3...原创 2018-11-08 20:28:17 · 724 阅读 · 0 评论