javascript multiline dict declaration
<p>I'm having an issue. I want to have a static dict</p>

<pre><code>var myDict={"aaa":true,"aab":false,"aac":false,"aad":true, [...] };
</code></pre>

<p>There are a lot of entries, and I want to have an easy access to all of them in case I need to change their value. Because of this, I don't like the single-line declaration. </p>

<p>As an alternative, I did manage to do the following, since multi-line text is allowed in Javascript:</p>

<pre><code>var dict = {};
var loadDict = function() {

    text = "aaa,true\n\
aab,false\n\
aac,false\n\
aad,true\n\[...]";

    var words = text.split( "\n" );
    for ( var i = 0; i &lt; words.length; i++ ) {
        var pair = words[i].split(",");
        dict[ pair[0].trim() ] = pair[1].trim();
    }   
}
</code></pre>

<p>Is there a better/more elegant way of having a multi-line declaration of a dict?</p>

<p>note: <a href="http://stackoverflow.com/questions/805107/how-to-create-multiline-strings">How to create multiline strings</a> is a solution only for strings. it doesn't work with a dict.</p>

<p>edit: I was adding a '\' at the end of each line. That was the issue. thanks.</p>
