1. const p = Promise.race([
    2. fetch('/resource-that-may-take-a-while'),
    3. setTimeout(() => reject(new Error('request timeout')), 5000)
    4. })
    5. p
    6. .catch(console.error);