Why the array returned by the combinationSum function is empty (Javascript)?

The resultArr returned by the combinationSum function is empty. When I console log the ds array, it prints the correct answer, but the final output array is [[],[]]. var combinationSum = function(candidates, target) { const resultArr = [] function combinationSumHelper(idx, candidates, ds, target){ if(idx === candidates.length){ // base case if(target === 0){ console.log(ds) *// This… Read More Why the array returned by the combinationSum function is empty (Javascript)?