Okay ive been going over this and I just dont see where the 2 in the return comes from. I think the return is where im hung up. In the multiply( [2, 3, 4,], 2) example I gave everything makes sense until it returns 6.

function multiply(arr, n) {
if (n <= 0) {
return 1;
} else {
return multiply(arr, n - 1) * arr[n - 1];
}
}
console.log(multiply([2, 3, 4], 2))
/* n = 2;
if statement n is not <= 0;
else statement broken down n - 1 * [n - 1] or 2 - 1 * [2 - 1] or 1 * 3 = 3;
if statement 3 is not <=0;
else statment n - 1 * [n - 1] or 3 - 1 * [3 - 1] or 2 * 3 = 6;
Does this make sense and look correct? also, if so, why does it stop executing when it returns 6?*/

Yes, when the function is called passing 2 in for the second arg then inside the function n - 1 will equal 1 and thus arr[n-1] will be arr[2-1] which will be arr[1] which is the value 3 in this case. So you know that the part of the return statement after the multiplication sign is 3:

I got 3 because index position 1 in the array is 3 and n which is 1 * 3 = 3.
I think I am very confused on what multiply(arr, n - 1) is doing now. I thought it was just multiply([2, 3, 4], 1)?

Explain to me in as much detail as possible what this returns and why. There is nothing tricky going on here. If you think it is obvious then great, explain the obvious to me. But convince me that you understand how the recursions is working. Because what you wrote above:

n = 2;
if statement n is not <= 0;
else statement broken down n - 1 * [n - 1] or 2 - 1 * [2 - 1] or 1 * 3 = 3;
if statement 3 is not <=0;
else statment n - 1 * [n - 1] or 3 - 1 * [3 - 1] or 2 * 3 = 6;
Does this make sense and look correct? also, if so, why does it stop executing when it returns 6?

Does not sound like you understand how the recursion is working. Perhaps you didn’t write that as clearly as you wanted to? Maybe you do understand how it is working? I’m just trying to help you confirm that you do. But if you do understand and don’t need any more help then we can end this conversation. If that’s the case, then I would suggest you try explaining the solution to yourself for a different set of numbers, such as

multiply([3,7,11], 2)

Make sure you can completely explain to yourself how you get the answer.

I appreciate all your help so much, I do not think I fully understand this at all lol. Okay I will work through it and get back to you. Thank you agin sooo much because this is very frustrating and its making my brain hurt.

You are leaving out an important part though. You can’t just ignore things that are there You should be looking at it as:

multiply([2, 3, 4], 1)

Do you see how you are leaving out the function call? This is calling the function multiply passing it the arguments [2,3,4] and 1. Functions return a value. So what does that function call return? Look above at my earlier comments.