I wanna to select all props but one from a javascript object but doing in elegant way using ES6, is this possible?
example:
const myObj = { prop1, prop2, prop3 }
const newObj = {
…myObject.remove(prop3)
}
then newObj should be { prop1, prop2}
if destruct I can select some, or all
const newObj = {
…myObject
}
const {prop1, prop2} = myObjct
but I dont know how to select all but one.