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');