Can you write Javascript object init shorthand C# style?
<p>I have the following Javascript:</p>

<pre><code>function TestModel()
{
        this.name = "Testvalue";
        this.id = 0;
}

var test = new TestModel();
alert(test.name);
</code></pre>

<p>If I want to initialize an object with different parameters without the use of a constructor I would need to call the following code:</p>

<pre><code>var test = new TestModel();
test.name = "other value";
test.id = 5;
alert(test.name);
</code></pre>

<p>What I would like to do is something similar to the C# style:</p>

<pre><code>class TestModel
{
    public string name = "Testvalue";
    public int id = 0;
}

TestModel test = new TestModel() { name = "other value", id = 5 };
System.Windows.MessageBox.Show(test.name);
</code></pre>

<p>But if I try something like that in javascript it won't work.</p>

<p>In short: I am trying to init a object in 1 line without the use of a constructor. Is this possible in javascript?</p>
