How to automatically assign value to another key depending on some other key's value in an Object
<p>How do you achieve the following thing in Javascript</p>

<pre><code>1) var MyObject={
2)    tableView:true,
3)    chartView:!(this.tableView)
4) }
</code></pre>

<p>The code at line number 3 is not working. Whats wrong in that line ?</p>

<p>What i basically want to do is set "chartView" to opposite of "tableView" whenever tableView is set from code.</p>
