diff --git a/documentation/coffee/arguments.coffee b/documentation/coffee/arguments.coffee new file mode 100644 index 00000000..fd4f2fba --- /dev/null +++ b/documentation/coffee/arguments.coffee @@ -0,0 +1,4 @@ +backwards: => + alert(arguments.reverse()) + +backwards("stairway", "to", "heaven") \ No newline at end of file diff --git a/documentation/index.html.erb b/documentation/index.html.erb index b7512c52..dee4b3e0 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -83,6 +83,7 @@ The Existence Operator
Aliases
Splats
+ Arguments are Arrays
While Loops
Comprehensions (Arrays, Objects, and Ranges)
Array Slicing and Splicing with Ranges
@@ -109,7 +110,7 @@ Underscore.coffee, a port of Underscore.js to CoffeeScript, which, when compiled, can pass the complete Underscore test suite. - Or, clone the source and take a look in the + Or, clone the source and take a look in the examples folder.

@@ -372,6 +373,15 @@ coffee --print app/scripts/*.coffee > concatenation.js

<%= code_for('splats', true) %> +

+ Arguments are Arrays + If you reference the arguments object directly, it will be converted + into a real Array, making all of the + Array methods + available. +

+ <%= code_for('arguments', true) %> +

While Loops The only low-level loop that CoffeeScript provides is the while loop. @@ -472,8 +482,8 @@ coffee --print app/scripts/*.coffee > concatenation.js

Blocks Many common looping functions (in Prototype, jQuery, and Underscore, - for example) take a single function as their final argument. To make - final functions easier to pass, CoffeeScript includes block syntax, + for example) take a single function as their final argument. To make + final functions easier to pass, CoffeeScript includes block syntax, so you don't have to close the parentheses on the other side.

<%= code_for('blocks') %> @@ -524,7 +534,7 @@ coffee --print app/scripts/*.coffee > concatenation.js
  • BistroCar
    - A Rails plugin by + A Rails plugin by Jonas Nicklas that includes CoffeeScript helpers, bundling and minification. @@ -541,7 +551,7 @@ coffee --print app/scripts/*.coffee > concatenation.js