I don't see the point of this.greeting = greeting as greeting is not defined and initialised. The following code should be sufficient. Also you do not need to return UserClass.
UserClass.prototype.greeting = function() {
return 'Hello, it is nice to see you!';
}
I don't see the point of
this.greeting = greeting
asgreeting
is not defined and initialised. The following code should be sufficient. Also you do not need to returnUserClass
.