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

38 lines
842 B
JavaScript
Raw Normal View History

(function(){
var _a, _b, _c, _d, cubes, list, math, num, number, opposite, race, square;
2010-04-03 20:43:50 -04:00
var __slice = Array.prototype.slice;
2009-12-26 02:17:34 -05:00
number = 42;
opposite = true;
if (opposite) {
number = -42;
}
2010-05-15 01:18:05 -04:00
square = function(x) {
return x * x;
};
2009-12-26 02:17:34 -05:00
list = [1, 2, 3, 4, 5];
math = {
root: Math.sqrt,
square: square,
2010-05-15 01:18:05 -04:00
cube: function(x) {
return x * square(x);
}
};
2010-05-15 01:18:05 -04:00
race = function(winner) {
2010-01-05 00:34:18 -05:00
var runners;
2010-05-15 01:18:05 -04:00
var _a = arguments.length, _b = _a >= 2;
runners = __slice.call(arguments, 1, _a - 0);
2010-01-05 00:34:18 -05:00
return print(winner, runners);
};
if (typeof elvis !== "undefined" && elvis !== null) {
2010-01-05 00:34:18 -05:00
alert("I knew it!");
}
cubes = (function() {
2010-04-03 20:43:50 -04:00
_a = []; _c = list;
for (_b = 0, _d = _c.length; _b < _d; _b++) {
num = _c[_b];
2010-02-21 11:45:03 -05:00
_a.push(math.cube(num));
}
2010-02-21 11:45:03 -05:00
return _a;
2010-04-11 17:57:29 -04:00
})();
2010-02-24 18:27:10 -05:00
})();