Created
November 11, 2012 21:12
-
-
Save knxroot/4056290 to your computer and use it in GitHub Desktop.
JS_OO Base
This file contains 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
var Persona = { | |
nombre: "", | |
getNombre: function(){ | |
this.pensar('Entrego mi nombre<br/>'); | |
return this.nombre; | |
}, | |
setNombre: function(nombre){ | |
this.pensar('Cambio mi nombre<br/>'); | |
this.nombre=nombre; | |
}, | |
pensar: function(pensamiento){ | |
document.write(pensamiento); | |
} | |
}; | |
Persona.setNombre("Gustavo"); | |
document.write('Mi nombre es '+Persona.getNombre()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment