I want to make an array out of sum of positive numbers in row, but my code counts negative elements if they're standing in first column. Can I get some help with this please?
My code:
<!DOCTYPE html>
<html>
<head>
    <title>Document</title>
</head>
<body>
    <div id="result-container"></div>
          <script>
          let myArray = [3]; 
        
              for (let i = 0; i < 3; i++) { 
                myArray[i] = [];  
                for (let j = 0; j < 3; j++) { 
                  myArray[i][j] = Math.floor(Math.random() * 20 - 10) + 1;  
                } 
        } 
          
        let output = myArray;
        
        console.log(myArray);
        let F = [];
              for (let i = 0; i < myArray[0].length; i++) {
                let posSum = myArray[i][0];
                for (let j = 1; j < myArray.length; j++) {
                  if (myArray[i][j] > 0) {
                    posSum += myArray[i][j];
                  }
                }
          F.push(posSum);
        }
        output += `Array F: ${F}`;
        console.log(F);
        document.getElementById('result-container').innerHTML = output;
          </script>
</body>
</html>
Example of problem: problem
 
    