Extend a function - merge two functions?
I am in some new territory now, I haven't worked with this sort of thing in a while.

What is the best way to have a Javascript 'class' for instance 

    // In the parent instance
    function xyz()
    {
        var x = 1;
    }

I want to set this in the class, and when a user extends a class, I want them to effectively be extending this function. I know I'm not being clear, but it's been a long day. This is the user's code for instance.

    // In the child instance
    function xyz()
    {
        var y = 2;
    }

Merging should result in:

    // In the merged instance
    function xyz()
    {
        var x = 1;
        var y = 2;
    }

Am I smoking the wrong stuff or asking the wrong question?
Extend a function - merge two functions?
===

I am in some new territory now, I haven't worked with this sort of thing in a while.

What is the best way to have a Javascript 'class' for instance 

    // In the parent instance
    function xyz()
    {
        var x = 1;
    }

I want to set this in the class, and when a user extends a class, I want them to effectively be extending this function. I know I'm not being clear, but it's been a long day. This is the user's code for instance.

    // In the child instance
    function xyz()
    {
        var y = 2;
    }

Merging should result in:

    // In the merged instance
    function xyz()
    {
        var x = 1;
        var y = 2;
    }

Am I smoking the wrong stuff or asking the wrong question?