JavaScript Mini-Max Sum - Returns 0 : <p>I'm trying to resolve the Mini-Max Sum Challenge from HackerRank. Why my code returns 0?
<a href="https://www.hackerrank.com/challenges/mini-max-sum/problem" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/mini-max-sum/problem</a></p>

<p>Been trying different codes and still doesn't work.</p>

<pre><code>function miniMaxSum(arr) {
    let maxSum = 0;
    let minSum = 0;
    arr.sort();

    for (let i = 0; i &lt; arr.leight; ++i) {
        minSum += arr[i];
    }
    for (let i = 1; i &lt; arr.leight; ++i) {
        maxSum += arr[i];
    }
    console.log(minSum, maxSum)

}
</code></pre>

<p>I expect a output like 10 14, but the actual output is 0 0.</p>
