I'll attempt to explain it better but it can be a little confusing even then :D
You are using the condition compare at X of the array, so you're checking that a value at position X is = to some value.
So the condition would normally be, compare at position 0 = 1, that's what you're trying to achieve.
Instead you are passing a parameter through a function which is fine so its compare at position param = 0, so youre comparing if position 0 = 1.
However in your events, instead of using a 0, or the parameter, you've used array.at(param) which is a value in the array.
So you are saying if at POSITION : array.at(0) is equal to VALUE 1.
array.at(0) is the value at X=0 which is 1.
So it becomes a comparison, if X=1 is equal to 1 because you've replaced the position you want which is 0, with the value AT 0 in the array.
Look at the condition without the function, you are comparing a POSITION is such a VALUE. You replaced what would normally be a 0, with a parameter 0. Which was my correction, it should just be arrayposition = 0. You've gone one step further inception style and said if the value at position(position(0)) in the array) so if the value at position(1) is 1, if X=1 is 1.
array.at(x) is looking into the array for a value. It's confusing but think about it...
Another way to look at it : Value at ( Value at array=0 ) = 1 becomes Value at 1 = 1. It should just be Value at (0) = 1 or Value at (param) = 1.
If this doesn't get through I'm not sure what else to suggest. It should click after reading that I hope.