title: adding multiple values to an array or object in javascript
body: <p>i like to have array or object like:</p>
  
  <pre><code>[0]
     text:"first"
     id: 1
  [1]
     text:"second"
     id: 2
  [2]
     text:"third"
     id: 3
  </code></pre>
  
  <p>getting myself:</p>
  
  <pre><code>1: first
  2: 1
  3: second
  4: 2
  5: third
  6: 3
  </code></pre>
  
  <p>here is my <strong>javascript</strong> with implementation for the <strong>array</strong> at the moment:</p>
  
  <pre><code> var numberOfQuestions = questionaireResult.numberOfQuestions;
                  var i;
                  var j;
                  var result = [];
  
                  for (i = 0; i &lt; numberOfQuestions; i++) {
                      debugger;
                      var question = questionaireResult.questions[i].text;
                      var questionID = questionaireResult.questions[i].id;
  
  
                      for (j = 0; j &lt; questionaireResult.questions[i].answers.length; j++) {
  
                          var text = questionaireResult.questions[i].answers[j].text;
                          var id = questionaireResult.questions[i].answers[j].id;
                          result.push(text, id);
                      }
  }
  </code></pre>
  
  <p>please help to get a structured array or object</p>