title: Array length not working
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13310566/array-length-undefined">Array length undefined</a>  </p>
  </blockquote>
  
  
  
  <p>I have the following array but whenever I try to find out the length with <code>categoryData.length</code> it gives me only <code>undefined</code>. If I type <code>console.log(categoryData)</code> it gives me all the objects in the array.</p>
  
  <pre><code>var categoryData = {
  animals: {
      name: "Animals",
      description: "All your favorites from aardvarks to zebras.",
      items: [
          {
              name: "Pets"
          },
          {
              name: "Farm Animals"
          },
          {
              name: "Wild Animals"
          }
      ]
  },
  colors: {
      name: "Colors",
      description: "Fresh colors from the magic rainbow.",
      items: [
          {
              name: "Blue"
          },
          {
              name: "Green"
          },
          {
              name: "Orange"
          },
          {
              name: "Purple"
          },
          {
              name: "Red"
          },
          {
              name: "Yellow"
          },
          {
              name: "Violet"
          }
      ]
  },
  vehicles: {
      name: "Vehicles",
      description: "Everything from cars to planes.",
      items: [
          {
              name: "Cars"
          },
          {
              name: "Planes"
          },
          {
              name: "Construction"
          }
      ]
  }
  </code></pre>
  
  <p>};</p>