For default object values is there a reason you are spreading out the two objects. Is there an advantage over doing
const createButton = (config) => { return { color: "#dcdcdc", disabled: false, title: "", padding: 0, ...config }; }
or using the default values in the arguments?
const createButton = ({ title = "", color = "#333", disabled = false, padding = 0 }) => { return { title, color, disabled, padding }; };
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For default object values is there a reason you are spreading out the two objects. Is there an advantage over doing
or using the default values in the arguments?