PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/documentation/js/array_comprehensions.js

http://github.com/jashkenas/coffee-script
JavaScript | 24 lines | 18 code | 5 blank | 1 comment | 4 complexity | b858f37f21bdcfb416535fc347e0589d MD5 | raw file
 1// Generated by CoffeeScript 1.10.0
 2var courses, dish, food, foods, i, j, k, l, len, len1, len2, ref;
 3
 4ref = ['toast', 'cheese', 'wine'];
 5for (j = 0, len = ref.length; j < len; j++) {
 6  food = ref[j];
 7  eat(food);
 8}
 9
10courses = ['greens', 'caviar', 'truffles', 'roast', 'cake'];
11
12for (i = k = 0, len1 = courses.length; k < len1; i = ++k) {
13  dish = courses[i];
14  menu(i + 1, dish);
15}
16
17foods = ['broccoli', 'spinach', 'chocolate'];
18
19for (l = 0, len2 = foods.length; l < len2; l++) {
20  food = foods[l];
21  if (food !== 'chocolate') {
22    eat(food);
23  }
24}