No, this syntax is incorrect (no offense);)
You need to create an object to use its prototypes. That means you need a constructor (which is a function in JavaScript). Applies to your problem:
var MyJsProgram = function (value1, value2) {
this.someVar = value1;
this.someVar2 = value2;
};
Create a new object as follows:
var jsProgramInstance = new MyJsProgram(value1, value2);
Prototypes are instances of these objects. They are defined as follows:
MyJsProgram.prototype.someSharedMethodName = function () {
};
Use them like this (on your previously created instance):
jsProgramInstance.someSharedMethodName();
, , (- ):
MyJsProgram.prototype = {
someSharedMethodName: function () {
},
};