Last active
January 25, 2021 10:54
-
-
Save schmidtfx/f60cb058a01562ee80294f711c9b8435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's define an original function | |
const my_func = (param1, param2) => { | |
}; | |
const result = my_func(1, 2); | |
// Ohh, I want to update my orginal function with additional fields, but won't break backwards compatibility | |
const my_func = (param1, param2, {onClick} = {}) => { | |
} | |
const result = (1, 2, { | |
onClick: (ev) => { } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment