有没有一种干净的方法来返回一个新对象,忽略原始对象包含的某些属性,而不必使用像 lodash 这样的东西?
const { bar, baz, ...qux } = foo
现在你的对象qux具有以下所有属性foo除了bar and baz.
qux
foo
bar
baz