omit key from object js

Solutions on MaxInterview for omit key from object js by the best coders in the world

showing results for - "omit key from object js"
Manuel
01 May 2017
1o = {a: 1, b: 2, c: 3, d: 4}
2exclude = new Set(['a', 'b'])
3Object.fromEntries(Object.entries(o).filter(e => !exclude.has(e[0])))
4// Object { c: 3, d: 4 }
similar questions
queries leading to this page
omit key from object js