I want to do a framework (academically) animations in JavaScript and Canvas, I began to look for guides DONE of object-oriented programming with javascript and I find too many variations.
examples:
// Example 1
var object = {
public_method: function(){ //do something }
}
// Example 2
function object(){
this.public_method = function(){ //do something }
}
var o = new object();
which is the correct or best way (simple and light) to do so.
note: that good design pattern for this kind of project?