Skip to content

Instantly share code, notes, and snippets.

@fastman
Created August 22, 2012 17:40
Show Gist options
  • Save fastman/3427826 to your computer and use it in GitHub Desktop.
Save fastman/3427826 to your computer and use it in GitHub Desktop.
SampleClass
var SampleClass = function () {
this._variable = 'test_variable';
};
(function () {
this.sampleMethod = function () {
console.log('Hello world');
};
this.getVariable = function () {
return this._variable;
};
}).call(SampleClass.prototype);
var e = new SampleClass();
e.sampleMethod();
console.log(e.getVariable());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment