Google script - Exceeded maximum execution time , help optimize
<p>google script spreadsheet
Novice</p>

<p>I try to create a matrix , if the array is a small database everything works fine, of course if it exceeds 800 lines and more rests on the error "You have exceeded the maximum allowed run time ." Not effectively create a matrix :</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var s = SpreadsheetApp.getActiveSheet(); //List
var toAddArray = []; //Greate Arr
  for (i = 1; i &lt;= s.getLastRow()+1; ++i){ //Start getting Value
  var numbr = s.getRange(i,4); //detect range
   var Valus = numbr.getValues().toString(); //get value
    
    //filter value
  var newznach = Valus.replace(/\-/g, "").replace(/[0-9][0-9][0-9][0-9][0-9][a-zA-Zа-яА-Я][a-zA-Zа-яА-Я]/g, "").replace(/[a-zA-Zа-яА-Я][a-zA-Zа-яА-Я]/g, "");
  toAddArray.push([i.toFixed(0),Valus,newznach]); //add to array 0- Row numb, 1- Value, 2- "filtered" value
  }</code></pre>
</div>
</div>
</p>

<p>toAddArray =</p>

<pre><code>{
Row, Value, NewValue - filtered
Row, Value, NewValue - filtered
Row, Value, NewValue - filtered
...
}
</code></pre>

<p>Can I somehow get an array of the same the other way ( faster, easier ) ?</p>