diff --git a/ejercicios.js b/ejercicios.js index 1e73eec..120f723 100644 --- a/ejercicios.js +++ b/ejercicios.js @@ -36,4 +36,13 @@ for (fruta of frutas){ function saludar(nombre, edad) { return `Hola! Me llamo ${nombre} y tengo ${edad} aƱos.`; } -console.log(saludar("Andrea","35")) \ No newline at end of file +console.log(saludar("Andrea","35")) +const numeros = [1, 2, 3, 4, 5, 6, 7, 8]; +console.log(numeros.filter(n=> n % 2 === 0).map(n => n*n)) +const productos = [ + { nombre: "Teclado", precio: 800 }, + { nombre: "Monitor", precio: 3500 }, + { nombre: "Mouse", precio: 600 }, + { nombre: "Auriculares", precio: 1200 } +]; +console.log(productos.filter(u=> u.precio < 1000).map(u => u.nombre))