79090470

Date: 2024-10-15 14:48:49
Score: 0.5
Natty:
Report link

I found two ways to do this, which work for me, using empty catch or timeout.

const x = async value => await console.log(value);

class Boss {
  constructor() {
    // Option 1: use empty catch
    x(1).catch(_ => {});
    
    // Option 2: use timeout
    setTimeout(() => x(2), 0);
  }
}

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Hung Tran