_.omit
Returns a copy of the object, filtered to omit the keys specified.
- var object = { 'a': 1, 'b': '2', 'c': 3 };
- // Underscore/Lodash
- var result = _.omit(object, ['a', 'c']);
- console.log(result)
- // output: { 'b': '2' }
- // Native
- var { a, c, ...result2 } = object;
- console.log(result2)
- // output: { 'b': '2' }
Browser Support for Spread in object literals
60.0 ✔ | ✖ | 55.0 ✔ | ✖ | 37.0 ✔ | ✖ |
当前内容版权归 you-dont-need 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 you-dont-need .