I have this function.
function foo(newdata) {
utils.method('GET', '/auth', {
response: {
data: {
settings: {
last_email_notification_shown_date: new Date(),
email_notifications: null,
}
...newdata
}
}
});
}
But every time I want to update the 'settings' property, I have to pass all of it to data:
foo(settings {
last_email_notification_shown_date: new Date(),
email_notifications: null,
SomeNewProperty: 'whatever'
})
Is there a way to update the 'settings' property in this function without the need to rewrite it whole? I just want to update the property, not to override it.