Tutorial by Examples

The most basic instance of an if construct evaluates a condition and executes some code according to the condition outcome. If the condition returns true, the code within the conditional is executed. counter = 10 if counter is 10 console.log 'This will be executed!' The if construct can be e...
TL; DR: CoffeeScript switch statements use when for each case and else for the default case. They use then for one-line cases and commas for multiple cases with a single outcome. They intentionally disallow fallthrough and so don't need an explicit break (since it's always there implicitly). A switc...

Page 1 of 1