diff --git a/docs/v1/index.html b/docs/v1/index.html index b6824515..54cedab6 100644 --- a/docs/v1/index.html +++ b/docs/v1/index.html @@ -555,7 +555,8 @@ pre .xml .cdata { Destructuring Assignment Bound and Generator Functions Embedded JavaScript - Switch and Try/Catch + Switch/When/Else + Try/Catch/Finally Chained Comparisons String Interpolation, Block Strings, and Block Comments Tagged Template Literals @@ -853,7 +854,7 @@ cubes = (function() {
This reference is structured so that it can be read from top to bottom, if you like. Later sections use ideas and syntax previously introduced. Familiarity with JavaScript is assumed. In all of the following examples, the source CoffeeScript is provided on the left, and the direct compilation into JavaScript is on the right.
Many of the examples can be run (where it makes sense) by pressing the run button on the right, and can be loaded into the “Try CoffeeScript” console by pressing the load button on the left.
-First, the basics: CoffeeScript uses significant whitespace to delimit blocks of code. You don’t need to use semicolons ;
to terminate expressions, ending the line will do just as well (although semicolons can still be used to fit multiple expressions onto a single line). Instead of using curly braces { }
to surround blocks of code in functions, if-statements, switch, and try/catch, use indentation.
First, the basics: CoffeeScript uses significant whitespace to delimit blocks of code. You don’t need to use semicolons ;
to terminate expressions, ending the line will do just as well (although semicolons can still be used to fit multiple expressions onto a single line). Instead of using curly braces { }
to surround blocks of code in functions, if-statements, switch, and try/catch, use indentation.
You don’t need to use parentheses to invoke a function if you’re passing arguments. The implicit call wraps forward to the end of the line or block expression.
console.log sys.inspect object
→ console.log(sys.inspect(object));
This reference is structured so that it can be read from top to bottom, if you like. Later sections use ideas and syntax previously introduced. Familiarity with JavaScript is assumed. In all of the following examples, the source CoffeeScript is provided on the left, and the direct compilation into JavaScript is on the right.
Many of the examples can be run (where it makes sense) by pressing the ▶ button on the right. The CoffeeScript on the left is editable, and the JavaScript will update as you edit.
-First, the basics: CoffeeScript uses significant whitespace to delimit blocks of code. You don’t need to use semicolons ;
to terminate expressions, ending the line will do just as well (although semicolons can still be used to fit multiple expressions onto a single line). Instead of using curly braces { }
to surround blocks of code in functions, if-statements, switch, and try/catch, use indentation.
First, the basics: CoffeeScript uses significant whitespace to delimit blocks of code. You don’t need to use semicolons ;
to terminate expressions, ending the line will do just as well (although semicolons can still be used to fit multiple expressions onto a single line). Instead of using curly braces { }
to surround blocks of code in functions, if-statements, switch, and try/catch, use indentation.
You don’t need to use parentheses to invoke a function if you’re passing arguments. The implicit call wraps forward to the end of the line or block expression.
console.log sys.inspect object
→ console.log(sys.inspect(object));
try
expressions have the same semantics as try
statements in JavaScript, though in CoffeeScript, you may omit both the catch and finally parts. The catch part may also omit the error parameter if it is not needed.