I am sure this is really, really simple but why does the following not work.
var o = function() { };
o.prototype.print = function( ) { console.log("hi") };
o.print(); // console message: Object function o() { } has no method 'print'
Fiddle here
UPDATE
Why does this also not work
var o = function() { };
o.prototype.print = function( ) { console.log("hi") };
var c = Object.create( o );
c.print();
I can start a new question if necessary.
1. Question
ois a constructor for new objects, you have to create a new object in order to use prototype methods:2. Question
Because
Object.createtakes a prototype and not an object:See also