1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/documentation/js/array_comprehensions.js

20 lines
463 B
JavaScript
Raw Normal View History

2009-12-21 11:41:45 -05:00
(function(){
2009-12-26 20:46:31 -08:00
var __a, __b, __c, __d, __e, __f, __g, __h, food, i, lunch, row;
// Eat lunch.
2009-12-25 23:17:34 -08:00
__a = ['toast', 'cheese', 'wine'];
__d = [];
for (__b=0, __c=__a.length; __b<__c; __b++) {
food = __a[__b];
2009-12-25 00:16:56 -08:00
__d[__b] = food.eat();
2009-12-21 11:41:45 -05:00
}
2009-12-25 00:16:56 -08:00
lunch = __d;
// Zebra-stripe a table.
2009-12-25 23:17:34 -08:00
__e = table;
__h = [];
for (__f=0, __g=__e.length; __f<__g; __f++) {
row = __e[__f];
i = __f;
2009-12-25 14:43:24 -08:00
__h[__f] = i % 2 === 0 ? highlight(row) : null;
2009-12-21 11:41:45 -05:00
}
2009-12-25 14:43:24 -08:00
__h;
2009-12-21 11:41:45 -05:00
})();