// At the beginning this will just be the sum of the first two array elements
for (let i = 0; i <subArrLength;i++){
maxSum += arr[i];
}
// Map temporary sum to maxSum
// Accordingly, as we have only mapped the first sub-array, the max sum will be the same
// as the current sum
tempSum = maxSum;
// Move through the array one element at a time (`i++`) via a window starting from the element that is equal to `subArrLength`
// The first sum calculation is already taken care of in the earlier loop and stored in `maxSum`, so we don't have to worry about missing the elements in indices less than subArrLength
for (let i = subArrLength; i <arr.length;i++){
// Temp sum becomes a moveable window value equal to the subtraction of the previous element and the addition of next element in line