From 8d74922dcc000a6676011b4b382477903e90b802 Mon Sep 17 00:00:00 2001 From: PopicaMihai Date: Mon, 9 Mar 2020 08:52:46 -0700 Subject: [PATCH] Fixes for problem number 1 --- index.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..3561e9e --- /dev/null +++ b/index.js @@ -0,0 +1,25 @@ +const cleanRoom = () => { + return new Promise((res) => { + res('Cleaned the room'); + }); +} + +const removeGarbage = (mes) => { + return new Promise((res) => { + res(`${mes} Removed garbage`); + }); +} + +const winIcecream = (msg) => { + return new Promise((res) => { + res(`${msg} Won Icecream`); + }); +} + +cleanRoom().then((res) => { + removeGarbage(res).then((res) => { + winIcecream(res).then((resP) => { + console.log(`abcdefg ${resP}`); + }); + }); +}) \ No newline at end of file