Skip to content

Instantly share code, notes, and snippets.

@alejandrolechuga
Created March 17, 2019 05:46
Show Gist options
  • Save alejandrolechuga/e51c9d7876f9ad2a2543c299c3b0afe6 to your computer and use it in GitHub Desktop.
Save alejandrolechuga/e51c9d7876f9ad2a2543c299c3b0afe6 to your computer and use it in GitHub Desktop.
export class Animal {
constructor(name) {
this.name = name;
}
print() {
console.log(`Soy animal del tipo ${this.name}`);
}
}
export class Oso extends Animal {
constructor() {
super('Oso');
}
}
export class Perro extends Animal {
constructor() {
super('Perro');
}
}
export function ejemplo() {
console.log('function ejemplo');
}
export const configuracion = {definiciones: 4};
// module.exports = Animal;
console.log('Corriendo desde Nodejs')
import * as Animales from './animal.mjs';
const pato = new Animales.Animal('Pato');
pato.print();
const oso = new Animales.Oso();
oso.print();
const perro = new Animales.Perro();
perro.print();
Animales.ejemplo();
console.log(Animales.configuracion);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment