2009-12-23 19:42:18 -05:00
|
|
|
(function(){
|
2010-06-28 00:19:58 -04:00
|
|
|
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;
|
2010-06-28 00:19:58 -04:00
|
|
|
opposite = true;
|
|
|
|
if (opposite) {
|
2009-12-23 19:42:18 -05:00
|
|
|
number = -42;
|
|
|
|
}
|
2010-05-15 01:18:05 -04:00
|
|
|
square = function(x) {
|
2009-12-23 19:42:18 -05:00
|
|
|
return x * x;
|
|
|
|
};
|
2009-12-26 02:17:34 -05:00
|
|
|
list = [1, 2, 3, 4, 5];
|
|
|
|
math = {
|
2009-12-23 19:42:18 -05:00
|
|
|
root: Math.sqrt,
|
|
|
|
square: square,
|
2010-05-15 01:18:05 -04:00
|
|
|
cube: function(x) {
|
2009-12-23 19:42:18 -05:00
|
|
|
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);
|
|
|
|
};
|
2010-06-28 00:19:58 -04:00
|
|
|
if (typeof elvis !== "undefined" && elvis !== null) {
|
2010-01-05 00:34:18 -05:00
|
|
|
alert("I knew it!");
|
|
|
|
}
|
2010-06-28 00:19:58 -04:00
|
|
|
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));
|
2009-12-31 16:50:46 -05:00
|
|
|
}
|
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
|
|
|
})();
|