let arr = [2, 4, 1, 3, 5]; let result = 0; for (let i = 0; i < arr.length; i++) { result += arr[i]; } console.log(result); // 15