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

/documentation/js/overview.js

http://github.com/jashkenas/coffee-script
JavaScript | 45 lines | 35 code | 9 blank | 1 comment | 4 complexity | 1d89178ae3a838c11f6a4d7ad80bc81d MD5 | raw file
 1// Generated by CoffeeScript 1.10.0
 2var cubes, list, math, num, number, opposite, race, square,
 3  slice = [].slice;
 4
 5number = 42;
 6
 7opposite = true;
 8
 9if (opposite) {
10  number = -42;
11}
12
13square = function(x) {
14  return x * x;
15};
16
17list = [1, 2, 3, 4, 5];
18
19math = {
20  root: Math.sqrt,
21  square: square,
22  cube: function(x) {
23    return x * square(x);
24  }
25};
26
27race = function() {
28  var runners, winner;
29  winner = arguments[0], runners = 2 <= arguments.length ? slice.call(arguments, 1) : [];
30  return print(winner, runners);
31};
32
33if (typeof elvis !== "undefined" && elvis !== null) {
34  alert("I knew it!");
35}
36
37cubes = (function() {
38  var i, len, results;
39  results = [];
40  for (i = 0, len = list.length; i < len; i++) {
41    num = list[i];
42    results.push(math.cube(num));
43  }
44  return results;
45})();