alternative for lodash omit in javascript

57

const omitSingle = (key, { [key]: _, ...obj }) => obj
const profile = { name: 'Maria', age: 30 }

const result = omitSingle('name', profile)

console.log(result)

Comments

Submit
0 Comments