Files
30-seconds-of-code/test/omit/omit.js
2018-01-19 20:10:17 +00:00

5 lines
154 B
JavaScript

const omit = (obj, arr) =>
Object.keys(obj)
.filter(k => !arr.includes(k))
.reduce((acc, key) => ((acc[key] = obj[key]), acc), {});
module.exports = omit