jquery,underscore,lodash那些事儿

一、参考链接

https://jquery.com/

https://en.wikipedia.org/wiki/JQuery

https://developer.mozilla.org/zh-CN/docs/Glossary/jQuery

http://underscorejs.org/

http://www.css88.com/doc/underscore/

http://javascript.ruanyifeng.com/library/underscore.html

https://lodash.com/

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;
});

 

转载于:https://www.cnblogs.com/camille666/p/underscore_lodash_jquery.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值