Which Promise Resolves Faster?

Published by JChick in

Given two promises, create a function to determine whether the second promise is faster than the first. If it is, return true. Otherwise, return false.

Examples

speedTest(promise1, promise2) ➞ true
// promise2 resolves faster

speedTest(promise1, promise2) ➞ false
// promise1 resolves faster

Notes

  • Make sure you await both promises when executing them.
  • Check the Resources tab for a hint.
Watch a quick demo on how Edabit works.