Files
30-seconds-of-code/test/omit/omit.js
2018-02-04 17:38:39 +02: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;