mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-09-20 07:43:04 +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
|
* @param {number} comboLength
|
||||||
* @return {*[]}
|
* @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
|
// If the length of the combination is 1 then each element of the original array
|
||||||
// is a combination itself.
|
// is a combination itself.
|
||||||
if (comboLength === 1) {
|
if (comboLength === 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user