From b9cdcf043eb6fc270213b1126c0f071aa8cdc1ce Mon Sep 17 00:00:00 2001 From: lucio <47898791@terciariourquiza.edu.ar> Date: Thu, 7 May 2026 23:04:55 -0300 Subject: [PATCH] primeros 2 hechos --- .vscode/launch.json | 15 +++++++++++++++ ejercicios.js | 6 ++++++ index.html | 1 + 3 files changed, 22 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..29d0764 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/ejercicios.js b/ejercicios.js index c12f2d1..d13c471 100644 --- a/ejercicios.js +++ b/ejercicios.js @@ -8,6 +8,8 @@ console.log("Archivo vinculado correctamente."); luego `map` para elevarlos al cuadrado. */ const numeros = [1, 2, 3, 4, 5, 6, 7, 8]; + +const resultados=numeros.filter(n => n % 2 === 0).map(n => n * 2); // Resultado esperado: [4, 16, 36, 64] @@ -24,6 +26,10 @@ const productos = [ { nombre: "Mouse", precio: 600 }, { nombre: "Auriculares", precio: 1200 } ]; + +const producto=productos.filter(u => u.precio> 1000); +const nombres=productos.map(u => u.nombres); +console.log(nombres); // Resultado esperado: ["Teclado", "Mouse"] // Pista: se puede resolver encadenando `filter` y `map`. diff --git a/index.html b/index.html index b44ebd0..0f79a77 100644 --- a/index.html +++ b/index.html @@ -12,4 +12,5 @@ +