Files
meteor/docs/client/packages/coffeescript.html

26 lines
868 B
HTML

<template name="pkg_coffeescript">
{{#better_markdown}}
## `coffeescript`
[CoffeeScript](http://coffeescript.org/) is a little language that
compiles into JavaScript. It provides a simple syntax without lots of
braces and parentheses. The code compiles one-to-one into the
equivalent JS, and there is no interpretation at runtime.
CoffeeScript is supported on both the client and the server. Files
ending with `.coffee` or `.litcoffee` are automatically compiled to
JavaScript.
Global variables can be set in CoffeeScript by using `this` (or CoffeeScript's
`@` shorthand), because at the top level `this` refers to the global namespace
(`window` on the client and
[`global`](http://nodejs.org/api/globals.html#globals_global) on the server).
Thus
@myFunction = -> 123
at the top level sets the global variable `myFunction`.
{{/better_markdown}}
</template>