Hacker News new | past | comments | ask | show | jobs | submit login

I don't see the problem...

    function doSomething() {
      return new Promise((resolve,reject)={
        setTimeout(reject,100);
      })
      .catch(() => [])
    }

    doSomething().then((arg) => console.log(arg));



The problem may have just been the docs. They say .catch and .then can be composed but I didn't see any mention of the behavior.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: