Test case details

Preparation Code

// Functional inheritance     var object = function () {       var that = {         prop: 'prop',         method: function () {           return that.prop;         }       };       return that;     };                 // Prototypal inheritance     var inherits = function(Child, Parent) {       function F() { }       F.prototype = Parent.prototype;       Child.prototype = new F;     };         var Object = function () {};     Object.prototype.prop = 'prop';     Object.prototype.method = function () {       return this.prop;     };                 // Prototypal inheritance where all functions are bound to this     var BObject = function () {       this.method = this.method.bind(this);     };     BObject.prototype.prop = 'prop';     BObject.prototype.method = function () {       return this.prop;     };             var o = object();         var O = new Object();         var B = new BObject();

Test cases

Test #1

var _x = object();

Test #2

var _y = new Object;

Test #3

var _xx = o.method();  

Test #4

var _yy = O.method();  

Test #5

var _z = new BObject();

Test #6

var _zz = B.method();