In my function (x) i declared a calling method to it's prototype, but that's not calling, instead i am getting error.
here is my function:
var x = function () {
console.log('i am called');
this.y('child called'); // getting error
}
x.prototype.y = function(msg){
console.log(msg);
}
x();