Is it possible to do object initialization in JavaScript similar to C#?
<p>More specifically, for a random class with two public properties, in C# you can do something like this : </p>

<pre><code>new Point() {
   Y = 0,
   X = 0
}
</code></pre>

<p>Is it possible to do something similar in JavaScript? I was thinking of something along the line of :</p>

<pre><code>{
   prototype : Object.create(Point.prototype),
   X : 0,
   Y : 0
}
</code></pre>

<p>but I don't think it works as intended. Or a simple copy function : </p>

<pre><code>function Create(object, properties) {
    for (p in properties)
        object[p] = properties[p];

    return object;
}
</code></pre>

<p>so the object initialization would become : </p>

<pre><code>Create(new Point(), {X : 0, Y : 0});
</code></pre>

<p>but there is an extra object creation. Is there a better way of achieving this?</p>
