function omit(obj, arr) { const newObj = {}; const keys = Object.keys(obj); for (const key of keys) { if (arr.indexOf(key) === -1) { newObj[key] = obj[key]; } } return newObj; }