Last active
February 8, 2017 08:49
-
-
Save talhahasanzia/6379da9d3cb9035d3196cd033734241c to your computer and use it in GitHub Desktop.
Node JS tutorials.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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