From 23d9209825c5e1733ef193fb97f55ce75f5763c6 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:01:31 +0530 Subject: [PATCH] cleanup --- Chapter 12/password checker | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Chapter 12/password checker diff --git a/Chapter 12/password checker b/Chapter 12/password checker deleted file mode 100644 index 0d0fa3d..0000000 --- a/Chapter 12/password checker +++ /dev/null @@ -1,33 +0,0 @@ -const allowed = ["1234", "pass", "apple"]; - -function passwordChecker(pass) { - return allowed.includes(pass); -} - -function login(password) { - return new Promise((resolve, reject) => { - if (passwordChecker(password)) { - resolve({ - status: true - }) - } else { - reject({ - status: false - }) - } - }) -} - -function checker(pass) { - login(pass) - .then(token => { - console.log('Approve:'); - console.log(token) - }) - .catch(value => { - console.log('Reject:'); - console.log(value) - }) -} -checker('1234'); -checker('wrong');