Skip to content

Instantly share code, notes, and snippets.

@horaciod
Created October 9, 2017 20:20
Show Gist options
  • Save horaciod/fb74fc17da714326fa8d6915e0f3bdd3 to your computer and use it in GitHub Desktop.
Save horaciod/fb74fc17da714326fa8d6915e0f3bdd3 to your computer and use it in GitHub Desktop.
creacion de objetos desde prototipos luego se cambia algo al prototipo y eso se hereda.
function Bibliotecas() {
}
let b = new Bibliotecas();
b.nombre = 'uno' ;
console.log(b);
console.log(b.__proto__) ;
// se pueden moficar las clases (prototipos) despues de creados objetos heredados y aspi y todo funciona.
Bibliotecas.prototype.abrir = function(){console.log('abierta'); };
b.abrir();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment