Created
March 9, 2020 21:19
-
-
Save robertoandres24/274ba7907814285a532324e89184f7c9 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 arr = ["jose", "juan", "pedro", "diego" ] | |
function timeout(ms) { | |
return new Promise(resolve => setTimeout(resolve(console.log('during loop...')), ms)); | |
} | |
function processing(arr) { | |
let mapped = arr.map(name => name.toUpperCase()) | |
timeout(4000) | |
let filtered = mapped.filter(name => name.startsWith("J") ) | |
return filtered; | |
} | |
console.log(processing(arr)) | |
//.then(result => console.log(result) ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment