Created
August 12, 2018 21:31
-
-
Save dsdunn/86af845ae13cfc2351d9002052f16d1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isOverTen = (num) => { | |
return new Promise((resolve, reject) => { | |
if (num > 10) { | |
resolve(num + ' is greater than 10') | |
} else reject(num + ' is less than or equal to ten') | |
}); | |
} | |
const makeCaps = (arr) => { | |
return new Promise((resolve, reject) => { | |
let newArr = arr.map(item => { | |
if (typeof item != 'string') { | |
reject('only strings!') | |
} else return item.toUpperCase()} | |
) | |
resolve(newArr) | |
}) | |
} | |
const sort = (arr) => { | |
return new Promise((resolve, reject) => { | |
resolve(arr.sort()); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment