While reading Crockford's page on private members in JavaScript (), a question arose regarding the use of Prototype by developers.
For instance, consider this:
var Foo = new Object();
Foo.bar = function() { alert('Its a bar'); };
var x = Foo;
x.bar();
as opposed to
var Foo = function(){};
Foo.prototype.bar = function(){alert('Its a bar');};
var x = new Foo();
x.bar();
Both implementations achieve the same result, but are they truly identical? Could this impact inheritance at all?