Files
30-seconds-of-code/test/omit/omit.js
2018-08-02 13:49:33 +03:00

6 lines
165 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;