Using the Prototype object correctly
<p>HI,</p>

<p>I have a JavaScript program that's written with object literal syntax:</p>

<pre><code>var MyJsProgram = {

    someVar: value1,
    somevar2: value2,

    init : function() {
        //do some initialisation
    },

    libraryFunction : function() {

    },

    getStyle : function() {

    },

    extend : function() {

    }
}
</code></pre>

<p>There can be multiple instances of this script running at once. Should I move the common methods in to the prototype object of the myJsProgram? If so, <strong>is this syntax correct?</strong></p>

<pre><code> var MyJsProgram = {

    someVar: value1,
    somevar2: value2,

    init : function() {
        //do some initialisation
    },

    //more methods/members here that are unique to each instance
}

myJsProgram.prototype = {
    //all shared methods here
}
</code></pre>

<p>?</p>
