mirror of https://github.com/nodejs/node.git
57 lines
2.6 KiB
JavaScript
57 lines
2.6 KiB
JavaScript
// Generated by CoffeeScript 2.5.1
|
|
(function() {
|
|
// Assignment:
|
|
var cubes, list, math, num, number, opposite, race, square;
|
|
|
|
number = 42;
|
|
|
|
opposite = true;
|
|
|
|
if (opposite) {
|
|
// Conditions:
|
|
number = -42;
|
|
}
|
|
|
|
// Functions:
|
|
square = function(x) {
|
|
return x * x;
|
|
};
|
|
|
|
// Arrays:
|
|
list = [1, 2, 3, 4, 5];
|
|
|
|
// Objects:
|
|
math = {
|
|
root: Math.sqrt,
|
|
square: square,
|
|
cube: function(x) {
|
|
return x * square(x);
|
|
}
|
|
};
|
|
|
|
// Splats:
|
|
race = function(winner, ...runners) {
|
|
return print(winner, runners);
|
|
};
|
|
|
|
// Existence:
|
|
if (true) {
|
|
alert("I knew it!");
|
|
}
|
|
|
|
// Array comprehensions:
|
|
cubes = (function() {
|
|
var i, len, results;
|
|
results = [];
|
|
for (i = 0, len = list.length; i < len; i++) {
|
|
num = list[i];
|
|
results.push(math.cube(num));
|
|
}
|
|
return results;
|
|
})();
|
|
|
|
}).call(this);
|
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRhYnMuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBYTtFQUFBO0FBQUEsTUFBQSxLQUFBLEVBQUEsSUFBQSxFQUFBLElBQUEsRUFBQSxHQUFBLEVBQUEsTUFBQSxFQUFBLFFBQUEsRUFBQSxJQUFBLEVBQUE7O0VBQ2IsTUFBQSxHQUFXOztFQUNYLFFBQUEsR0FBVzs7RUFHWCxJQUFnQixRQUFoQjs7SUFBQSxNQUFBLEdBQVMsQ0FBQyxHQUFWO0dBTGE7OztFQVFiLE1BQUEsR0FBUyxRQUFBLENBQUMsQ0FBRCxDQUFBO1dBQU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