Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions 03ejercicio/Album.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Album {
constructor (nombre, fecha ) {
this.nombre = nombre
this.fecha = fecha
}
}

module.exports = Album
8 changes: 8 additions & 0 deletions 03ejercicio/Autor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Autor {
constructor (nombre, pais) {
this.nombre = nombre
this.pais = pais
}
}

module.exports = Autor
13 changes: 13 additions & 0 deletions 03ejercicio/Cancion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Autor = require('./Autor'),
Album = require('./Album')
class Cancion {
constructor (titulo, duracion ,autor, album) {
this.titulo = titulo
this.duracion = duracion
this.autor = new Autor (autor.name, autor.pais)
this.album = new Album (album.name, album.fecha)
}

}

module.exports = Cancion
6 changes: 6 additions & 0 deletions 03ejercicio/DB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class DB {
constructor (canciones) {
this.canciones = canciones
}
}
module.exports = DB
8 changes: 8 additions & 0 deletions 03ejercicio/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const Cancion = require ('./Cancion'),
DB = require ('./DB')

let init = new DB([])
init.canciones
.push(new Cancion('cancion',4.3, {name: 'Luis', pais : 'Perú'}, {name :'Mejorando',fecha : '2019-05-03'}))

console.log(init.canciones)