fix : default length

comboLength must be have a  default value . function got stock.
This commit is contained in:
farid 2023-10-13 16:11:40 +03:30 committed by GitHub
parent 76617fa83a
commit c3f5eda5d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
* @param {number} comboLength
* @return {*[]}
*/
export default function combineWithRepetitions(comboOptions, comboLength) {
export default function combineWithRepetitions(comboOptions, comboLength = comboOptions.length) {
// If the length of the combination is 1 then each element of the original array
// is a combination itself.
if (comboLength === 1) {