memoize全局函数

https://www.jianshu.com/p/475...

curry全局函数

https://www.jianshu.com/p/111...

map全局函数

https://www.jianshu.com/p/7f5...

reduce全局函数

https://www.jianshu.com/p/8b6...

转换为字符串函数

https://www.jianshu.com/p/29a...

reject

http://www.jstips.co/zh_cn/ja...

function reject(obj, keys) {
    return Object.keys(obj)
        .filter(k => !keys.includes(k))
        .map(k => ({[k]: obj[k]}))
        .reduce((res, o) => Object.assign(res, o), {});
}

// 或者, 利用 pick
function reject(obj, keys) {
    const vkeys = Object.keys(obj)
        .filter(k => !keys.includes(k));
    return pick(obj, vkeys);
}

reject({a: 2, b: 3, c: 4}, ['a', 'b']); // => {c: 4}

ramda.js

Ramda 一款实用的 JavaScript 函数式编程库。
Ramda 库信息非常大,只对常用函数进行整理总结

object

array

base64

string


白鲸鱼
1k 声望110 粉丝

方寸湛蓝