以 pull 结尾的 lodash / underscore 链接

chaining in lodash / underscore ending with pull

我正在尝试学习链接 lodash/underscore..

我找到了一个很好的链接代码here..

var xs = [{a: 1, b: 2}, {b: 3, c: 4, d: 5}];

console.log(JSON.stringify(
_(xs).map(_.keys).flatten().unique().value()));

现在,我想从结果数组中删除一个值 'b'。

如果没有链接,我可以完成以下操作..

_.pull(list, 'b'); // ['a', 'c', 'd']

如果我想继续链或仅在特定条件下才可能链,我该怎么办..

谢谢

without 看起来是一个显而易见的选择:

console.log(JSON.stringify(
  _(xs).map(_.keys).flatten().unique().without('b').value()));