Use case: With promises, the expression body form of arrow functions is so 
convenient. Alas, `throw` being a statement, you can’t use it there. For 
example, the following code is not syntactically legal:

```js
asyncFunc()
.then(count => count >= 0 ? count : throw new Error(...))
.then(...)
.catch(...);
```

Could `throw` be turned into an expression?

-- 
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to