Color = function (r, g, b) { var that = Object.create(Color.prototype); that.red = r; that.green = g; that.blue = b; return that; } Color.prototype = {bits: 24}; c = Color(255,0,0); print("c.bits is " + c.bits);
Output