title: Javascript/jQuery - "Cannot call method 'push' of undefined" while it IS defined
body: <p>In a simple script that goes through some form fields, gets the user input and stores it into arrays I ran into a problem.</p>
  
  <p>It works when I do this:</p>
  
  <pre><code>var q1A = parseFloat($('#q1-1').val());
  if(isNaN(q1A)) {
      var q1A = 0;
  }
  parameter.push(' ');
  answers.push(q1A);
  </code></pre>
  
  <p>But now I added another array which, in this case, is supposed to simply store the same q1A variable. But somehow I end up with an "Uncaught TypeError" stating that the variable is undefined! The new code block is:</p>
  
  <pre><code>var q1A = parseFloat($('#q1-1').val());
  if(isNaN(q1A)) {
      var q1A = 0;
  }
  input.push(q1A);
  parameter.push(' ');
  answers.push(q1A);
  </code></pre>
  
  <p>I logged the variable in the console and it works just fine, it's set and has a value. Any idea why it says it's undefined? The 'answers' array stores the value just fine.</p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT:</p>
  
  <p>Of course I defined the variables. I just didn't post that part of the code...</p>
  
  <pre><code>var groups = new Array();
  var questions = new Array();
  var input = new Array();
  var parameter = new Array();
  var answers = new Array();
  var amounts = new Array();
  </code></pre>