How to create a self-aware prototype?
<p>In Javascript we often need to use class-like <code>function</code> objects. A class-like <code>function</code> object often needs public members instead of parameters, but this seems to be too labor-intensive on the long term:</p>

<pre><code>function MyClassLikeFunction(params) {
    this.width = (params.width === undefined) ? 50 : params.width;
    this.height = (params.height === undefined) ? 50 : params.height;
    this.name = (params.name === undefined) ? "foobar" : params.name;
    //And a lot of these initializations and some function definitions
}
</code></pre>

<p>Instead of this I intend to be able to define things like this:</p>

<pre><code>function MyClassLikeFunction(params) {
    //something to enable the behavior
    this.initialize("width", 50);
    this.initialize("height", 50);
    this.initialize("name", "foobar");
    //And a lot of these initializations and some function definitions
}
</code></pre>

<p>How can I achieve this?</p>