title: Why Array.length does not work with key string
body: <p>I've been reading and doing some testing and found that the command. "Length" of the Array () javascript does not work when the array's keys are string. I found that to run this command, I use whole keys.</p>
  
  <p>However, I wonder if any of you can tell me why this rule? Limitation of language, or specification of logic? Or, my mistake ...?</p>
  
  <p>Thanks</p>
  
  <p>Obs.: The key to my array is a string (name of component) but the values and the array of objects.</p>
  
  <p>Declarating:</p>
  
  <pre><code>objElementos = new Array();
  </code></pre>
  
  <p>Object: </p>
  
  <pre><code>objElemento = function(Id){
  this.Id        = $('#' + Id).attr('id');
  this.Name      = $('#' + Id).attr('name');
  this.CssLeft   = $('#' + Id).css('left');
  this.CssBottom = $('#' + Id).css('bottom');
  this.Parent    = $('#' + Id).parent().get(0);
  this.Childs    = new Array();
  
  this.addChild = function(IdObjChild) {
      try {
          if ($('#' + IdObjChild).attr('id') != '')
              this.Childs[$('#' + IdObjChild).attr('id')] = new objElemento(IdObjChild);
      } catch(err){ $('#divErrors').prepend('&lt;p&gt;' + err + '&lt;/p&gt;'); }
  }
  
  this.getChildCount = function(){
      try {
          $('#divErrors').prepend('&lt;p&gt;' + this.Childs.length + '&lt;/p&gt;');
          return this.Childs.length;
      } catch(err){ $('#divErrors').prepend('&lt;p&gt;' + err + '&lt;/p&gt;'); }
  }
  
  this.updateCssLeft = function(CssPosition){
      try {
          $('#divErrors').prepend('&lt;p&gt;updateCssLeft:' + this.Id + ' / ' + this.CssLeft + '&lt;/p&gt;');
  
          $('#' + this.Id).css('left',CssPosition);
          this.CssLeft = $('#' + this.Id).css('left');
  
          $('#divErrors').prepend('&lt;p&gt;updateCssLeft:' + this.Id + ' / ' + this.CssLeft + '&lt;/p&gt;');         
      } catch(err){ $('#divErrors').prepend('&lt;p&gt;' + err + '&lt;/p&gt;'); }
  }
  
  this.updateCssBottom = function(CssPosition){
      try {
          $('#divErrors').prepend('&lt;p&gt;updateCssBottom:' + this.Id + ' / ' + this.CssBottom + '&lt;/p&gt;');
  
          $('#' + this.Id).css('bottom',CssPosition);
          this.CssBottom = $('#' + this.Id).css('bottom');
  
          $('#divErrors').prepend('&lt;p&gt;updateCssBottom:' + this.Id + ' / ' + this.CssBottom + '&lt;/p&gt;');
      } catch(err){ $('#divErrors').prepend('&lt;p&gt;' + err + '&lt;/p&gt;'); }
  }
    }
  </code></pre>
  
  <p>Use:</p>
  
  <pre><code>objElementos['snaptarget'] = new objElemento('snaptarget');
  </code></pre>