JavaScript is very dynamic, so you can use OOP in various ways. Take a look at a couple of examples:
// -------------------------
// Using Prototype
var MyPrototype = function () {
// do something
};
MyPrototype.prototype.MyMethod1 = function() {
return this.MyMethod2();
};
MyPrototype.prototype.MyMethod2 = function() {
return "something";
};
// Usage
var myObj = new MyPrototype();
myObj.MyMethod2();
// -------------------------
// Using a object like an "static" class
var MyStaticObject = {
MyMethod1: function() {
return MyStaticObject.MyMethod2();
},
MyMethod2: function() {
return "Something";
}
};
// Usage
MyStaticObject.MyMethod1();
For futher understading, read those pages:
https://developer.mozilla.org/en-US/docs/JavaScript/Introduction_to_Object-Oriented_JavaScript
http://killdream.github.com/blog/2011/10/understanding-javascript-oop/