title: Javascript equivalent of VBS redim preserve
body: <p>I'm trying to rewrite some old VBScript as Javascript for an ASP.NET application and there is one line I'm not sure how to translate, and I'm not even entirely positive what it's doing. </p>
  
  <p>The application essentially allows the user to enter in a new employee number to add to the database and then assign it user permissions. Don't ask me why the code is such a mess, I didn't write it originally, I'm just trying to make it work in Chrome</p>
  
  <p>here's the relevant code that i've managed to translate so far:</p>
  
  <pre><code>if(form1.txtEmpno.value != ""){
  var oOption;
  oOption = document.createElement("OPTION");
  oOption.text=form1.txtEmpno.value;
  oOption.value=form1.txtEmpno.value;
  form1.lstActive.add (oOption);
  oOption = document.createElement("OPTION");
  oOption.text="";
  oOption.value="";
  form1.lstPerms.add (oOption);
  redim preserve arrUsers(1,ubound(arrUsers,2)+1);
  arrUsers(0,ubound(arrUsers,2)) = form1.txtEmpno.value;
  arrUsers(1,ubound(arrUsers,2)) = "";
  form1.txtEmpno.value = "";
  oOption = null;
  }
  </code></pre>
  
  <p>here's the line in question:</p>
  
  <pre><code>redim preserve arrUsers(1,ubound(arrUsers,2)+1);
  </code></pre>