On 1 June 2013 20:52, Jorge <[email protected]> wrote:
> On 02/06/2013, at 01:22, Brandon Benvie wrote:
> > On 6/1/2013 3:44 PM, Jorge wrote:
> {
> block: {
> if (true) {
> break block;
> }
> }
> }
>
> But then... I'm not sure this is any better than an IIFE!
>
>
Anything is better than an "Immediately Invoked Function-silly-Expression",
actually. The only reasonable use for that is to create a new scope in the
context of a statement:
void function() {
doSomething()
}()
Block scoping/let makes this pattern completely unecessary. As for the
other arguments, you do not wrap a function expression in parenthesis,
they're already expressions so there's no need for that. At any rate, the
problem here is JavaScript's usage of statements instead of Expressions,
Expressions Everywhere.
e.g.:
var x = function(){ return foo }()
--
--
Quildreen "Sorella" Motta (http://killdream.github.com/)
*— JavaScript Alchemist / Minimalist Designer / PLT hobbyist —*
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss