将数组中的空值去除
const arrContainsEmptyVal = [3, 4, 5, 2, 3, undefined, null, 0, “”];
将数组中重复项清除
const uniq = arr => […new Set(arr)];
取出对象中的深层属性
1 | const pluckDeep = path => obj => |
将 Stark 家族成员提取出来。注意,目标数据在数组前面,使用 filter 方法遍历整个数组是浪费。
1 | const takeWhile = f => ([head, ...tail]) => |