I was working on my solution and I got very close to Solution 1. However, I was not getting the correct result because I was using ‘i’ in the for loop and not ‘a’.
Can someone explain to me why we use ‘a’ and not ‘i’?
I understand the function in sort() can be any other characters (so say, (d,e) and it would sort the same and then we return d), just wondering if anyone can point me in the right direction, to a reference for understanding this.
no, i understand why we use ‘i’ and how that can also be any character. i dont know why im struggling to grasp why we use ‘a’ in the for loop, same letter as the function in sort. why MUST those letters be the same.
and by the way, yes in my code I use let and var, but thank you.