What does {x:1} do in Javascript? <p>From Javascript: The Definitive Guide,</p> <pre><code>var o = { x:1 }; // Start with an object o.x = 2; // Mutate it by changing the value of a property o.y = 3; // Mutate it again by adding a new property </code></pre> <p>What does { x: 1} do here? With the braces, it reminds me of function (or for objects, constructor). Can someone please elaborate on it, thanks.</p> <p>An additional related question is:</p> <pre><code>({x:1, y:2}).toString() // =&gt; "[object Object]" </code></pre> <hr> <p>I find this question interesting as well. What is the difference between object and Object in the above code? In fact, when do we use Object? </p>