多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## negate + [link](./negate "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L8877 "View in source.") + [npm](https://www.npmjs.com/package/lodash.negate "See the npm package.") ``` _.negate(predicate) ``` 创建一个对 `func` 结果 取反的函数。 用 predicate 对 `func` 检查的时候,`this` 绑定到创建的函数,并传入对应参数。 ### 参数 1. predicate (Function) 需要对结果取反的函数 ### 返回值 (Function) 返回一个新函数 ### 示例 ``` function isEven(n) { return n % 2 == 0; } _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5] ```