title: Check array in JS - is list sorted?
body: <p>I need to create a program that checks the list in the array is sorted. I have three input data:</p>
  
  <p>1,2,3,4,5 </p>
  
  <p>1,2,8,9,9 </p>
  
  <p>1,2,2,3,2</p>
  
  <p>So here is my code:</p>
  
  <pre><code>let sorts = +gets(); // 3
  let list = [];
  
  for (let i = 0; i &lt; sorts; i++) {
      list[i] = gets().split(',').map(Number); // The Array will be: [ [ 1, 2, 3, 4, 5 ], [ 1, 2, 8, 9, 9 ], [ 1, 2, 2, 3, 2 ] ]
  }
  
  for (let i = 0; i &lt; list[i][i].length; i++){
      if (list[i][i] &lt; list[i][i +1]) {
          print('true');
      } else {
          print('false');
      }
  }
  </code></pre>
  
  <p>I need to print for all lists on new line true or false. For this example my output needs to be:</p>
  
  <p>true</p>
  
  <p>true</p>
  
  <p>false</p>
  
  <p>I have no idea how to resolve this.</p>