Run-time of a summation function and its complexity
The body of the inner for loop is executed in constant time per iteration and it does not affect the number of iterations of the outer loops.
Let $n$ be the length of array. The outer for loop iterates $n$ times. During the $i$-th iteration of the outer loop, the inner for loop iterates $i$ times.
The overall time complexity is therefore:
$$
\Theta(1) \cdot \sum_{i=1}^{n} i = \Theta(1) \cdot \Theta(n^2) = \Theta(n^2).
$$