2010-10-25 01:50:34 +00:00
|
|
|
var _i, _len, cubes, list, math, num, number, opposite, race, square;
|
2010-07-29 04:51:35 +00:00
|
|
|
var __slice = Array.prototype.slice;
|
|
|
|
number = 42;
|
|
|
|
opposite = true;
|
|
|
|
if (opposite) {
|
|
|
|
number = -42;
|
|
|
|
}
|
|
|
|
square = function(x) {
|
|
|
|
return x * x;
|
|
|
|
};
|
|
|
|
list = [1, 2, 3, 4, 5];
|
|
|
|
math = {
|
|
|
|
root: Math.sqrt,
|
|
|
|
square: square,
|
|
|
|
cube: function(x) {
|
|
|
|
return x * square(x);
|
2009-12-24 00:42:18 +00:00
|
|
|
}
|
2010-07-29 04:51:35 +00:00
|
|
|
};
|
|
|
|
race = function(winner) {
|
|
|
|
var runners;
|
|
|
|
runners = __slice.call(arguments, 1);
|
|
|
|
return print(winner, runners);
|
|
|
|
};
|
2010-08-24 02:08:33 +00:00
|
|
|
if (typeof elvis !== "undefined" && elvis !== null) {
|
2010-07-29 04:51:35 +00:00
|
|
|
alert("I knew it!");
|
|
|
|
}
|
2010-10-25 01:50:34 +00:00
|
|
|
for (_i = 0, _len = list.length; _i < _len; _i++) {
|
|
|
|
num = list[_i];
|
|
|
|
cubes = math.cube(num);
|
|
|
|
}
|