mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
fix : default length
comboLength must be have a default value . function got stock.
This commit is contained in:
parent
76617fa83a
commit
c3f5eda5d9
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user