Why are my objects showing up as "[object Object]"?
<p>I'm trying to bubble sort an array of records by age but all I get is: </p>

<blockquote>
  <p>[object Object], [object Object], [object Object]</p>
</blockquote>

<p>How can I get it to display the values of the record?</p>

<pre><code>students = [
    {name: "timothy", age: "9"},
    {name: "claire",  age: "12"},
    {name: "michael", age: "20"}
];

for (var i = 0; i &lt; students.length; i++) {
    for (var j = i + 1; j &lt; students.length; j++) {
        if (Number(students[i].age) &gt; Number(students[j].age)) {
            tempValue = students[j].age;
            students[j].age = students[i].age;
            students[i].age = tempValue;
        }
    }
}

alert(students);
</code></pre>
