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/range_comprehensions.js

19 lines
476 B
JavaScript
Raw Normal View History

2010-09-21 23:58:05 -04:00
var _result, countdown, deliverEggs, num;
2010-07-29 00:51:35 -04:00
countdown = (function() {
2010-09-21 23:58:05 -04:00
_result = [];
2010-07-29 00:51:35 -04:00
for (num = 10; num >= 1; num--) {
2010-09-21 23:58:05 -04:00
_result.push(num);
2010-07-29 00:51:35 -04:00
}
2010-09-21 23:58:05 -04:00
return _result;
2010-02-24 18:27:10 -05:00
})();
2010-07-29 00:51:35 -04:00
deliverEggs = function() {
2010-09-21 23:58:05 -04:00
var _ref, _result2, dozen, i;
_result2 = []; _ref = eggs.length;
for (i = 0; (0 <= _ref ? i < _ref : i > _ref); i += 12) {
_result2.push((function() {
2010-07-29 00:51:35 -04:00
dozen = eggs.slice(i, i + 12);
return deliver(new eggCarton(dozen));
})());
}
2010-09-21 23:58:05 -04:00
return _result2;
2010-07-29 00:51:35 -04:00
};