1const user = { 2 email: "e@mail.com", 3 password: "12345" 4} 5 6const updateUser = ({ email, password }) => { 7 if (email) { 8 Object.assign(user, { email }) 9 } 10 11 if (password) { 12 user.password = password 13 } 14 15 return user 16} 17 18const updatedUser = updateUser({ email: "new@email.com" }) 19 20console.log(updatedUser === user)
本题为“单选题”