function saveSettings(settings) {
console.log(settings);
}
saveSettings({
followAlert: true,
unfollowAlert: true,
mrkAlert: true,
themeColor: "green"
});
function saveSettings2({ notifications, color: { theme } }) {
console.log(notifications, theme);
}
saveSettings2({
notifications: {
follow: true,
alert: true,
mkt: false
},
color: {
theme: "blue"
}
});
saveSettings function 인자로 followAlert,unfollowAlert,mrkAlert,themeColor를 다 때려박는 것보다 saveSettings function을 호출할 때 키,값을 인자로 하면 코드가 더 간결해진다.