Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JS_POO Base
window.Persona = window.Persona || {};
window.Persona = (function () {
"use strict";
function Persona() {
}
var nombre = "";
Persona.prototype.getNombre = function () {
pensar('Entrego mi nombre<br/>');
return this.nombre;
};
Persona.prototype.setNombre = function (nombre) {
pensar('Cambio mi nombre<br/>');
this.nombre=nombre;
};
function pensar(pensamiento){
document.write(pensamiento);
}
return Persona;
}());
var gustavo = new Persona();
gustavo.setNombre("Gustavo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.