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
import { PelisCollection, Peli } from "./models"; | |
class PelisController { | |
pelis: PelisCollection; | |
promesa: Promise<any>; | |
constructor() { | |
this.pelis = new PelisCollection(); | |
let promesa = this.pelis.getAll(); | |
this.promesa = promesa; |
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
const datos = [ | |
{ | |
nombre: "ana", | |
edad: 25, | |
}, | |
{ | |
nombre: "margara", | |
edad: 55, | |
}, | |
{ |
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
// crear las clases Edificio, Piso y Departamento aquí | |
class Departamento { | |
nombreDepartamento: string; | |
constructor(nombre: string) { | |
this.nombreDepartamento = nombre; | |
} | |
getName() { | |
return this.nombreDepartamento; | |
} |
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
const pelis = require("./pelis.js"); | |
function parsearARGV(argv) { | |
const respuesta = {}; | |
argv.forEach((element, ind) => { | |
if (element.startsWith("--")) { | |
const nombreSinGuiones = element.slice(2); | |
const key = nombreSinGuiones.replace("-", ""); | |
respuesta[key] = argv[ind + 1]; |
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
const textos = [ | |
{ | |
titulo: " un titulo ", | |
texto: "uno dos tres cuatro cinco", | |
}, | |
{ | |
titulo: "1984 ", | |
texto: "es una novela política de ficción distópica", | |
}, | |
{ |
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
// Escribir acá la función cuentaPalabras | |
function cuentaPalabras(text) { | |
let textEnMinusculas = text.toLowerCase(); | |
let separador = " "; | |
let wordKeeper = textEnMinusculas.split(separador); | |
let palabrasConA = 0; | |
let cantidadDePalabras = wordKeeper.length; | |
let counter = 0; |