一、参考链接
https://en.wikipedia.org/wiki/JQuery
https://developer.mozilla.org/zh-CN/docs/Glossary/jQuery
http://www.css88.com/doc/underscore/
http://javascript.ruanyifeng.com/library/underscore.html
https://en.wikipedia.org/wiki/Lodash
http://www.css88.com/doc/lodash/
二、区别联系
1、jquery
操作DOM,BOM,跨平台,选择元素,动画,ajax,jquery取代了prototype。
2、underscore
和DOM,BOM无关,写react或者nodejs都可以用underscore,它有丰富的函数库,处理数据,字符串。
3、lodash
和DOM,BOM无关,写react或者nodejs都可以用lodash,它有更加丰富的函数库,处理数据,字符串,可以按需加载,性能比underscore高4-5倍,会彻底取代underscore。
// 公用标签,交集 let commonLabel = []; if (inRiskLabel.length > outRiskLabel.length) { commonLabel = _.intersectionWith(inRiskLabel, outRiskLabel, _.isEqual); } else { commonLabel = _.intersectionWith(outRiskLabel, inRiskLabel, _.isEqual); } // 左边标签,差集 let leftTag = _.differenceWith(inRiskLabel, commonLabel, _.isEqual); // 右边标签,差集 let rightTag = _.differenceWith(outRiskLabel, commonLabel, _.isEqual); // 去重 uniqueKeyArr = _.uniqBy(keyArr, e => { return e.id; });