From c3f5eda5d9f4d60c278027586ac8dacbe5e82c73 Mon Sep 17 00:00:00 2001 From: farid <66198773+allmightdude@users.noreply.github.com> Date: Fri, 13 Oct 2023 16:11:40 +0330 Subject: [PATCH] fix : default length comboLength must be have a default value . function got stock. --- src/algorithms/sets/combinations/combineWithRepetitions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/sets/combinations/combineWithRepetitions.js b/src/algorithms/sets/combinations/combineWithRepetitions.js index 5e25635d..057b7e51 100644 --- a/src/algorithms/sets/combinations/combineWithRepetitions.js +++ b/src/algorithms/sets/combinations/combineWithRepetitions.js @@ -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) {