Created
September 8, 2022 15:33
-
-
Save DoctorDerek/6383a792a9fecc30fab058957cf3991e to your computer and use it in GitHub Desktop.
Why You Should Always Pass Objects as Function Parameters in JavaScript https://medium.com/p/7fb7c5833dc6
This file contains hidden or 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
// @/utils/getChartOptions.js | |
export default function getChartOptions( | |
chartData, | |
maximum, | |
limitOne, | |
limitTwo, | |
percent, | |
extraOptions | |
) { | |
const defaultChart = getDefaultChart( | |
chartData, | |
maximum, | |
limitOne, | |
limitTwo, | |
percent | |
) | |
if (!extraOptions) return defaultChart | |
return { ...defaultChart, ...extraOptions } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment