What is the best way to create top-level scopes in ES6?

This isn’t possible, any more, right (given that nested module won’t be in ES6)?

```js
module {
    let foo = ...;
}
```

Then we are left with:

```js
{
    'use strict';
    let foo = ...;
}
```

On the other hand, it would be nice to have `do { ... }` blocks (of which I 
don’t know the current status), which would eliminate the remaining use case 
for IIFEs. With do blocks, the above would become shorter:

```js
do {
    let foo = ...;
}
```

It may make sense to terminate this expression statement with a semicolon.

Axel

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to