diff --git a/README b/README index 50896694..a89bdd60 100644 --- a/README +++ b/README @@ -34,7 +34,8 @@ To suggest a feature, report a bug, or general discussion: http://github.com/jashkenas/coffee-script/issues/ - If you'd like to chat, drop by #coffeescript on Freenode. + If you'd like to chat, drop by #coffeescript on Freenode IRC, + or on webchat.freenode.net. The source repository: git://github.com/jashkenas/coffee-script.git diff --git a/documentation/index.html.erb b/documentation/index.html.erb index 6b14569d..d75ec7da 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -773,7 +773,9 @@ coffee --print app/scripts/*.coffee > concatenation.js Bugs reports, feature requests, and general discussion all belong here.
var _a, _b, _c, cubed_list, list, math, num, number, opposite_day, race, square; +// Assignment: +number = 42; +opposite_day = true; +// Conditions: +if (opposite_day) { + number = -42; +} +// Functions: +square = function square(x) { + return x * x; +}; +// Arrays: +list = [1, 2, 3, 4, 5]; +// Objects: +math = { + root: Math.sqrt, + square: square, + cube: function cube(x) { + return x * square(x); + } +}; +// Splats: +race = function race(winner) { + var runners; + runners = Array.prototype.slice.call(arguments, 1); + return print(winner, runners); +}; +// Existence: +if ((typeof elvis !== "undefined" && elvis !== null)) { + alert("I knew it!"); +} +// Array comprehensions: +cubed_list = (function() { + _a = []; _b = list; + for (_c = 0; _c < _b.length; _c++) { + num = _b[_c]; + _a.push(math.cube(num)); + } + return _a; +}).call(this); +
For a longer CoffeeScript example, check out
@@ -1571,7 +1653,9 @@ task('test
Bugs reports, feature requests, and general discussion all belong here.