One liner to delete multiple object properties

前端 未结 3 1395
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 22:29

I have a few object properties I need to delete at certain point but I still need others so I can\'t just write delete vm.model; to remove all of it.

At the

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 22:53

    Check this out:

    > const {a,b, ...newArray} = {a:1,b:2,c:3,d:4}
    > newArray
    { c: 3, d: 4 }
    

提交回复
热议问题