Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WaldoJeffers/60473bfd20d070959743f1857000c2fa to your computer and use it in GitHub Desktop.
Save WaldoJeffers/60473bfd20d070959743f1857000c2fa to your computer and use it in GitHub Desktop.
const result = await Promise
.all(Object.values(obj).map(isEven))
.then(results => Object.keys(obj).reduce((acc, key, index) => {
if (results[index]){
acc[key] = obj[key]
}
return acc
}, {}) // { books: 10 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment