Skip to content

Commit c1eda30

Browse files
#21-javascript
1 parent 8d4d8ae commit c1eda30

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Roadmap/21 - CALLBACKS/javascript/caterinarodriguezdev.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ legendario("Rodríguez", diMiApellido);
2828

2929
console.log("--------------DIFICULTAD EXTRA---------------");
3030

31+
const readline = require("readline");
32+
const rl = readline.createInterface(process.stdin, process.stdout);
33+
34+
rl.question("¿Qué le gustaría pedir? 🤌 ", (resp) => {
35+
pedir(resp, confirmar, notificarListo, notificarEntregado);
36+
});
37+
3138
const pedir = (nombrePlato, confirmar, notificarListo, notificarEntregado) => {
39+
console.log("\n");
40+
3241
confirmar(nombrePlato);
3342

43+
console.log('\n');
44+
3445
setTimeout(() => {
3546
notificarListo(nombrePlato);
47+
console.log("\n");
3648

3749
setTimeout(() => {
3850
notificarEntregado(nombrePlato);
@@ -51,10 +63,3 @@ const notificarListo = (nombrePlato) => {
5163
const notificarEntregado = (nombrePlato) => {
5264
console.log(`El pedido ${nombrePlato} ya se ha entregado 😲`);
5365
};
54-
55-
pedir(
56-
"Padthai con doble de lima 🍋",
57-
confirmar,
58-
notificarListo,
59-
notificarEntregado
60-
);

0 commit comments

Comments
 (0)