I'm investigating using prototypes in JavaScript to simulate using 'base classes' which can be 'extended'. I've created an example where `dialogBox` is my 'base' and `welcomeMessage` is the 'extension'.

```
// OBJECT CONSTRUCTORS

var dialogBox = function(xPosition, yPosition, width, height){
    this.x = xPosition;
    this.y = yPosition;
    this.width = width;
    this.height = height;
    this.draw = function(){
        STAGE.fillRect(this.x, this.y, this.width, this.height);
        STAGE.strokeRect(this.x, this.y, this.width, this.height);        
    };
};

var welcomeMessage = function(messageString){
    this.message = messageString;
    this.addMessage = function(){
        STAGE.strokeText(this.message, this.x + 10, this.y + 10, this.width-10);
        console.log(this.message);
    };
};
welcomeMessage.prototype = new dialogBox();

```

This works as intended (or at least gives the appearance of working as intended) - [**see this fiddle**](http://jsfiddle.net/Candlejack/4m552t6f/).

However, the way I have to instantiate these objects seems rather inelegant:

```
var box1 = new dialogBox(20, 20, 300, 100);

var box2 = new welcomeMessage('hello there');
box2.x = 20;
box2.y = 140;
box2.width = 300;
box2.height = 100; // wouldn't it be great if I could pass these properties as args?

```

I wrote these constructors using the [MDN Object.prototype reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype) and am following their example quite closely, but I've observed from reading around Stack Overflow / Code Review many examples where prototyping is used very [differently](https://codereview.stackexchange.com/questions/6015/class-design-in-javascript), often in relation to [getters](https://codereview.stackexchange.com/questions/51500/simple-javascript-sub-class-properties-getters-methods) and [setters](https://codereview.stackexchange.com/questions/29343/javascript-prototype-getters-setters-functions). This is leading me to question if I have quite grasped the 'proper' use of prototype.

Any feedback is welcome, but I am particularly interested in identifying any potential problems my approach could cause when applied to more complex situations.