Re: wip/new-model review



On sön, 2013-07-07 at 11:26 -0400, Colin Walters wrote:
(I really wish JS had a better array iteration
syntax...)

There's Array.forEach but maybe you are afraid of too many closures?
There's also for ... of loops which works in gjs in JHBuild, but it has
the disadvantage of not being standardized yet.

let arr = [1,2,3,4,5];

log("arr.forEach(f):");
arr.forEach(function(e) {
        log(e);
});

log("for e of arr:");
for(let e of arr) {
        log(e);
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]