This file contains hidden or 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
// todas las funciones se deben resolver en una linea de código (máximo 2) | |
function crearArrayDeObjetos(arrayDeNumeros, nombreDePropiedad) { | |
// si recibe [1,2,3,4] y "a" | |
// debe devolver | |
// [{ a:1 }, { a:2 }, { a:3 }, { a:4 }] | |
// usar método map | |
const arrayNuevo = arrayDeNumeros.map(function(item){ | |
return {[nombreDePropiedad]: item} |
This file contains hidden or 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 productos = [{ id: 123, nombre:"producto 1", stock:3 }, | |
{ id: 1323, nombre:"producto 2", stock:1 }, | |
{ id: 1253, nombre:"producto 3", stock:2 }, | |
{ id: 32, nombre:"producto 4", stock:63 }, | |
{ id: 1623, nombre:"producto 5", stock:35 }, | |
{ id: 3, nombre:"producto 6", stock:53 }, | |
{ id: 25, nombre:"producto 7", stock:66 }, | |
{ id: 37, nombre:"producto 8", stock:53 }, | |
{ id: 34, nombre:"producto 9", stock:343 }, | |
{ id: 177, nombre:"producto 10", stock:745 }, |
This file contains hidden or 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() { | |
//... acá ocurre la magia | |
const arguments = process.argv.slice(2); | |
let argObj = { | |
}; |