Is there a clean way to return a new object that omits certain properties that the original object contains without having to use something like lodash?
Omit and array of keys, using ES7 w/ recursion.
function omit(keys, obj) { if (!keys.length) return obj const { [keys.pop()]: omitted, ...rest } = obj; return omit(keys, rest); }
This builds on top of @Eddie Cooro answer.