Last active
February 6, 2019 05:27
-
-
Save alejandrolechuga/fcb254cce7999c20425b139a31c96acf to your computer and use it in GitHub Desktop.
Prototype
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 Doctor() { | |
} | |
Doctor.prototype.saludo = function() { | |
console.log(`Saludos soy el doctor ${this.getName()} y tengo ${this.getAge()} años`); | |
}; | |
var doctorAlejandro = new Doctor('Alejandro', 33); | |
doctorAlejandro.saludo(); // 'Saludos soy el doctor Alejandro y tengo 33 años' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment