Skip to content

Instantly share code, notes, and snippets.

@robertoandres24
Created March 9, 2020 21:19
Show Gist options
  • Save robertoandres24/274ba7907814285a532324e89184f7c9 to your computer and use it in GitHub Desktop.
Save robertoandres24/274ba7907814285a532324e89184f7c9 to your computer and use it in GitHub Desktop.
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