Files
30-seconds-of-code/test/omit/omit.js
2018-06-18 19:07:48 +03: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;