How to use prototype in this function

I’ve no idea how to get it works, or is it possible at all.


var x = 'Test Test Test';

var y = {
	z: function(i) {
		this.i = i;
		this.a(i);
	},
	a: function(b) {
		this.b = b;
		this.c(b);
	}
	a.prototype = {
		c: function() {
			console.log(this.b);
		}
	}
}
y.z(x);

Thank you,

Never mind. I get it worked.


var x = 'Test Test Test';

var y = {
	z: function(i) {
		this.i = i;
		this.a(i);
	},
	a: function(b) {
		var that = this;
		this.b = b;
		this.a.prototype = function(b) { that.d(b); }
		var c = this.a.prototype(b);
	},
	d: function(e) {
		this.e = e;
		console.log(e);
	}
}

y.z(x);