Set a value in a javascript object based on another key's value in the same object : <p>I'd like to define a javascript object in which the value of a key depends on the value of another, like so :</p>

<pre><code>var params = {
    width : 100,
    margins : 10,
    realWidth : width - margins
}
</code></pre>

<p>If I try this I get an error about width not being defined. 
Is it even possible to do that ?  </p>
