Everything in Javascript is an object. By object I mean a hash table (or dictionary, if you are coming from Python). Even functions and arrays are objects! Put that in your pipe and smoke it. Have a look at this code:
function FancyArray() {} // In this setting a function is just a fancy name for an object.
FancyArray.prototype = Array.prototype;
var my_new_fancy_array = new FancyArray();
my_new_fancy_array[0] = 'foo';
my_new_fancy_array.length = 1;
Remember that the square brackets and the dot notation are equivalent. This is very important. The last lines could be written like: my_new_fancy_array['0'] = 'foo';
my_new_fancy_array['length'] = 1;
Anyway, this will return you a psuedo Array => ['foo'] (This is the basis of how jQuery works). Going back to the first couple of lines, we made a new object, FancyArray, then set its prototype to the prototype of Array (so we get all the nice methods like toString and push etc.). We then created a new FancyArray.I'm going to cut this tutorial short because I have somewhere to be, but a good source of good Javascript is Douglas Crockford and his bite-sized book "Javascript the Good Parts" (and a good post of prototypical inheritance here http://javascript.crockford.com/prototypal.html). If you are willing to take a certain level of Russian crazy have a read of Dmitry's blog http://dmitry.baranovskiy.com/ (he wrote Raphaël). He gets it.
Back to Impel, the heavily OO code and the way things are named are a bit of a tell tale sign. The author is probably a Java or PHP programmer who has spent the night getting tipsy in this weird and wonderful gay bar and, hitting on the only chick around, hasn't checked the goods before he moved in for a kiss. Javascript is a beautiful language when you get to know it and accept that it's different from anything you've experienced before.