Created
March 17, 2019 05:46
-
-
Save alejandrolechuga/e51c9d7876f9ad2a2543c299c3b0afe6 to your computer and use it in GitHub Desktop.
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
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; |
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
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