title: Cannot push element to array after using querySelectorAll
body: <p>So I have a simple class with few properties. Using prototyping I add few methods.These methods returns <code>this</code>, so I could chain tham together. </p>
  
  <p><code>Get</code> method finds all elements and puts into <code>allCurrentElements</code>, which is an array (or at least I think so). And when I use <code>CreateElement</code> method, it simply creates element and tries to push it to existing array <code>allCurrentElements</code>. </p>
  
  <p>To use it, simply write <code>var a = _h.Get('p').CreateElement('div')</code>. And here is where I get an error <code>Uncaught TypeError: this.allCurrentElements.push is not a function(…)</code>.</p>
  
  <p>If I try to assign newly created element using index it does not throw error however, this element does not appear in the array.</p>
  
  <pre><code>var _h = (function(){
      var Helper = function(){
          this.allCurrentElements = [];
      }
  
      Helper.prototype.Get = function(query){
          this.allCurrentElements = document.querySelectorAll(query);
          return this;
      }
  
      Helper.prototype.CreateElement = function(el, attr) {
          var elem = document.createElement(el);
          for (var a in attr) {
              elem[a] = attr[a];
          }
  
          //this.allCurrentElements[this.allCurrentElements.length] = elem;
          this.allCurrentElements.push(elem);
          return this;
      }
  
      return new Helper();
  })();
  </code></pre>
  
  <p><a href="https://jsfiddle.net/Ldp58onu/" rel="nofollow">https://jsfiddle.net/Ldp58onu/</a></p>