Well, this.initialize.apply means what follows; "this" obviously is a reserved word.

DailyJS: Let's Make a Framework: OO Part 2:

Last week I was parading around initialize as if you were intimately familiar with prototype.js or Ruby. I apologise for that. In case I confused you, all you need to know is initialize is our way of saying call this method when you set up my class.

Turingโ€™s Class.create method sets up classes. During the setup it defines a function that will be called when the class is instantiated. So when you say new, it will run initialize. The code behind this is very simple:

  create: function() {
var methods = null,
parent = undefined,
klass = function() {
this.initialize.apply(this, arguments);
};

Labels: