if it helps, you can already "pattern-match" using string-concat like this
full-working-demo [1]
derived from a closed-source real-world example.
```html
*,
*:after,
*:before {
box-sizing: border-box;
}
body { background: #eee; display: flex; flex-flow: column; font-family: Arial,
After looking at a bunch of code in our system noted that there are many
cases where our code base has a pattern similar to this:
let category = data.category;
if (category === undefined) {
// Even if Tax is not enabled, we have defaults for incomeCode
switch
Not sure what the benefit is over just `if (value != null) throw value`,
especially for this niche of a use case.
On Sun, Feb 24, 2019 at 09:46 IdkGoodName Vilius <
viliuskubilius...@gmail.com> wrote:
> I am proposing a syntatic sugar, which would check if throw value is not
> null, or not
I am proposing a syntatic sugar, which would check if throw value is not
null, or not undefined. It would make less typing and no if, for throw
statements. Syntax is simple. Here's an example of it:
```js
throw? e
```
This is basically equivalent to:
```js
if(e !== null && e !== undefined) throw e
4 matches
Mail list logo