Skip to content

Instantly share code, notes, and snippets.

@talhahasanzia
Last active February 8, 2017 08:49
Show Gist options
  • Save talhahasanzia/6379da9d3cb9035d3196cd033734241c to your computer and use it in GitHub Desktop.
Save talhahasanzia/6379da9d3cb9035d3196cd033734241c to your computer and use it in GitHub Desktop.
Node JS tutorials.
function User() {
this.id=0;
this.name="";
this.description="";
this.newDescription=function (newDescriptionData) {
this.description=newDescriptionData;
};
}
D=new User();
E=new User();
D.id=1;
D.name="Danielle";
D.description="Danielle is a boy";
console.log(D);
E.id=2;
E.name="Emma";
E.description="Emma is a girl";
console.log(E);
D.newDescription("Danielle was a boy until the baseball hit him in the middle.");
console.log(D);
function User() {
this.id = 0;
this.name = "";
this.description = "";
this.newDescription = function (newDescriptionData) {
this.description = newDescriptionData;
};
}
D = new User();
E = new User();
D.id = 1;
D.name = "Danielle";
D.description = "Danielle is a boy";
console.log(D);
E.id = 2;
E.name = "Emma";
E.description = "Emma is a girl";
console.log(E);
D.newDescription("Danielle was a boy until the baseball hit him in the middle.");
console.log(D);
User.prototype.gender = "";
User.prototype.getGender = function getGender() {
return this.gender;
}
D.gender = "Unspecified";
E.gender = "Female";
console.log(D.getGender());
console.log(E.getGender());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment