title: JavaScript won't add values to array
body: <p>I have written a script that returns values. When I log the variable containing the values, it shows them, and they are correct. Then, no matter how I try, concat, push, equals, etc. when I attempt to add the values to an array, then immediately log the contents of the array, those values are not there or undefined. Here is my code, or at least a subset of it.</p>
  
  <pre><code>displayRange: function () {
      if( app.selectedObject !== undefined &amp;&amp; app.selectedObject.movement !== undefined &amp;&amp; app.selectActive === undefined ) {
  
          // holds rage
          t.rArray = [];
          t.oArray = [];
          app.selectActive = true;
          t.obj = app.selectedObject;
  
          // amount of allotted movement for unit
          t.len = t.obj.movement * 2;
  
          // loop through x and y axis
          for ( x = -t.len; x &lt; t.len; x += 1){
              for ( y = -t.len; y &lt; t.len; y += 1 ){
  
                  // return cost of each movement
                  t.hl = this.calcRange('x', x, y );
  
                  // if movement cost is less then or eual to the allotted movement then add it to the range array
                  if ( t.hl.move &lt;= t.obj.movement ){
                      // find obsticles
  
                      t.ex = t.hl.origin.x + x;
                      t.wy = t.hl.origin.y + y;
                      t.obsticle = this.findObsticles(t.ex, t.wy);        
  
                      // get the number of offset movement from the obsticle
                      if ( t.obsticle !== undefined ){
                          t.offset = app.settings.obsticleStats[t.obsticle.obsticle][app.selectedObject['type']];
                          if ( t.offset !== undefined ){
                              // make an array of offset values, starting point, plus movement, and the amount of offset beyond that movement
                              t.oArray.push(this.obsticleLogic( t.ex, t.wy, t.mx, t.my, t.offset ));
                          }
                      }
                      // add all values to array
                      t.rArray.push({ x: t.ex, y: t.wy, type:'highlight'});
                  }
              }
          }
  
          offsetArr = app.offsetArray( t.rArray, t.oArray );
          for ( l = 0; l &lt; offsetArr; l += 1 ){
              app.map.highlight.push(offsetArr[l]);
          }
  
          for ( i = 0; i &lt; t.oArray.length; i += 1 ){
              app.offset.push(t.oArray[x]);
          }
  
          console.log(t.oArray);
          console.log(offsetArr);
          console.log('offset:');
          console.log(app.offset);
          console.log('highlight');
          console.log(app.map.highlight);
  
          window.requestAnimationFrame(app.animateEffects);
      }
  
      return false;
  },
  </code></pre>
  
  <p>I have set app.map.highlight = [];
  in the app.map area. Same with app.offset.</p>
  
  <p>They have been declared, they are just in a different object.</p>
  
  <p>I can't understand why it won't add the values to the array. I log them and see them, then directly after call array push, and it sets everything to undefined. Why would this happen?</p>
  
  <p>The only reason they are being looped through to try and get them into the array is because that's the last thing I tried.</p>