Javascript delete object property not working

后端 未结 5 1722
难免孤独
难免孤独 2021-01-01 13:31

I\'m running some project on MEAN.js and I\'ve got a following problem. I want to make some user\'s profile calculation and the save it to database. But there\'s a problem w

5条回答
  •  一生所求
    2021-01-01 14:03

    Just do:

    user.password = undefined;
    

    instead of:

    delete user.password;
    

    and the password property will not appear at the output.

提交回复
热议问题