accessing data in javascript Object
<p>In this code which is returned from a FusionTable:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;meta charset="utf-8"&gt;
&lt;head&gt;
    &lt;script src="http://ft2json.appspot.com/api/ft2json.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;

    var doSomethingWithResult = function (result) {
        // do stuff with result object here
        for (var k in result) {
            console.log(k);
            var obj = result[k];
            for (var prop in obj) {
                console.log(prop + " = " + obj[prop]);
           }
        }
    };

    ft2json.query(
        'SELECT * FROM 1epTUiUlv5NQK5x4sgdy1K47ACDTpHH60hbng1qw', /* Fusion Tables query. */
        function(result) {
            /* Callback function. */
            doSomethingWithResult(result);
        },
        {
            /* Optional parameters. */
            //start : 25,
            //limit : 50
        }
    );
    &lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I get an Object which has 100 entries, such as:</p>

<pre><code>Object
count: 100
data: Array[100]
0: Object
Contact: "info@zeitgeistportugal.org"
Icon: "1"
Link: "http://www.zeitgeistportugal.org/"
Location: "Portugal"
Name: "Portugal"
Type: "Country"
__proto__: Object
1: Object
....
</code></pre>

<p>I would like to first group all the objects by 'Country' and 'Region' and create a nested list so that each Country lists all the Regions, something like:</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;a href="regionURI"&gt;RegionName&lt;/a&gt;&lt;/li&gt;
...

&lt;ul&gt;
    &lt;li class="country"&gt;&lt;a href="countryURI"&gt;CountryName&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;
        &lt;ul class="region"&gt;
            &lt;li&gt;&lt;a href="regionURI"&gt;RegionName&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="regionURI"&gt;RegionName&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;

    ... and for every object the same block pattern
&lt;/ul&gt;
</code></pre>
