(originally posted more than one year ago on Medium)
As you know, some months ago, it was announced the new features of ES6 or EcmaScript2015. In ...
For further actions, you may consider blocking this person and/or reporting abuse
ES6 allows the reverse as well which means the method above can be even neater, Also since the entire method is marked
asyncthere is no need for thetry/catchif your not interested in the error (as in the example above).Some Promise libraries offer a
hashfunction for this purpose:It does not make sense to create a rejectable Promise if it cannot be rejectable. So you can use directly: