Content deleted Content added
→Adoption: Appears to no longer be the case. Tags: Mobile edit Mobile web edit |
→Syntax: Add links. |
||
Line 29:
== Syntax ==
Almost everything is an [[expression (computer science)|expression]] in CoffeeScript, for example, <code>if</code>, <code>switch</code> and <code>for</code> expressions (which have no return value in JavaScript) return a value. As in [[Perl]], these control statements also have postfix versions; for example, <code>if</code> can also be written in <code> consequent if condition</code> form.
Many unnecessary parentheses and braces can be omitted; for example, blocks of code can be denoted by indentation instead of braces, function calls are implicit, and object literals are often detected automatically.
Line 142:
The <code>for ... in</code> syntax allows looping over arrays while the <code>for ... of</code> syntax allows looping over objects.
CoffeeScript has been criticized for its unusual [[Scope (computer science)|scoping]]
rules.<ref>{{cite web
|url=http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/
|