I have no idea what recursion is/ok, wtf just happened?

I think I’m in the same mindset as the OP on this problem, I do not understand how sum([2, 3, 4], 0) is returning a 1 and how [2, 3, 4][0] is returning 2.

Edit: Okay I completely overlooked sum([2, 3, 4], 0), because n=0 (sum(arr, n)) it returns 1, but I’m still confused on how you get 2 from [2,3,4][0].

Edit 2: Is [2,3,4][0] = 2 because the 0 element in the array is 2, and would [2,3,4][1] = 3?

Edit 3: It clicked for me. Some of the ways the code was written out in explanations in the post made it incredibly confusing because I wasn’t 100% sure what I was looking at.

Anyone looking for a very clear explanation of how this works look here