From 04305e284f2017feb7ca27637e21dfd32e73c8fa Mon Sep 17 00:00:00 2001 From: Billy Torres Date: Mon, 25 Dec 2023 07:38:56 -0600 Subject: [PATCH] Reto #11 - JavaScript --- .../javascript/BRivasTorres.js" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "Retos/Reto #11 - URL PARAMS [F\303\241cil]/javascript/BRivasTorres.js" diff --git "a/Retos/Reto #11 - URL PARAMS [F\303\241cil]/javascript/BRivasTorres.js" "b/Retos/Reto #11 - URL PARAMS [F\303\241cil]/javascript/BRivasTorres.js" new file mode 100644 index 0000000000..d57d3373ab --- /dev/null +++ "b/Retos/Reto #11 - URL PARAMS [F\303\241cil]/javascript/BRivasTorres.js" @@ -0,0 +1,16 @@ +const getDataUrl = (url) => { + const p = url.split("?")[1]; + const params = p.split("&"); + return params.map((param) => param.split("=")[1]); +} + + +console.log( + getDataUrl("https://retosdeprogramacion.com?year=2023&challenge=0") +); +console.log( + getDataUrl("https://retosdeprogramacion.com?year=2023&challenge=10") +); +console.log( + getDataUrl("https://retosdeprogramacion.com?year=2023&challenge=20") +); \ No newline at end of file