The prototype property is only useful on a function. In the Empty constructor you're setting it on each instance of Empty, so it basically does nothing.
A much better way to do inheritance with JavaScript than what you're trying to do is to set the prototype of the inheriting class to inherit from the prototype of the base class:
Empty.prototype = Object.create(Block.prototype);
... and in order to inherit the properties set in the base class constructor, you simply call it with the correct arguments in the inheriting class constructor:
Empty = function(location) {
Block.call(this, location); // call base class
// other code, specific to your inheriting class
}
Note that the Empty.prototype line should come after you define Empty:
Empty = function(location) {
Block.call(this, location); // call base class
// other code, specific to your inheriting class
}
Empty.prototype = Object.create(Block.prototype);
Finally, to make methods available to instances you can define them in the constructor for each instance:
Block = function() {
this.update = function() { };
}
... or on the prototype of the constructor (after you define the constructor, obviously):
Block.prototype.update = function() {};
I don't know your particular scenario, but it seems to me that your inheritance is slightly weird. Usually the base is the more generic type (with variable location) and the inheriting class specializes it. The base class would be Doctor (person who treats diseases) and the inheriting class would be Dentist (person who treats certain kinds of diseases).