look at where your return statement is
for recursion to work the function always needs to return something , and you need to do something with the returned value
do you do something with the returned value of your function calls?
Thanks i got answer, can you tell me one more thing how to take unknown number of arguments function destroyer(arr,d1,d2) instead of d1 and d2 if i want to take unknow number of args how do i take it.
I tried to find the solution i got this. i am not able to relate properly
var print_names = function(...names) {
for (let i=0; i<names.length; i++) console.log(names[i]);
}