6d9553a016
This let's you do things like: fullName = ({first = 'John', last = 'Doe'}) -> "#{first} #{last}" Note: CoffeeScrits treats `undefined` and `null` the same, and that's true in the case of destructuring defaults as well, as opposed to ES2015 which only uses the default value if the target is `undefined`. A similar ES2015 difference already exists for function parameter defaults. It is important for CoffeeScript to be consistent with itself. fullName2 = (first = 'John', last = 'Doe') -> "#{first} #{last}" assert fullName('Bob', null) is fullName2(first: 'Bob', last: null) Fixes #1558, #3288 and #4005. |
||
---|---|---|
bin | ||
documentation | ||
examples | ||
extras | ||
lib/coffee-script | ||
src | ||
test | ||
.gitignore | ||
.npmignore | ||
CNAME | ||
CONTRIBUTING.md | ||
Cakefile | ||
LICENSE | ||
README.md | ||
bower.json | ||
index.html | ||
package.json | ||
register.js | ||
repl.js |
README.md
{
} } {
{ { } }
} }{ {
{ }{ } } _____ __ __
{ }{ }{ { } / ____| / _|/ _|
.- { { } { }} -. | | ___ | |_| |_ ___ ___
( { } { } { } } ) | | / _ \| _| _/ _ \/ _ \
|`-..________ ..-'| | |___| (_) | | | || __/ __/
| | \_____\___/|_| |_| \___|\___|
| ;--.
| (__ \ _____ _ _
| | ) ) / ____| (_) | |
| |/ / | (___ ___ _ __ _ _ __ | |_
| ( / \___ \ / __| '__| | '_ \| __|
| |/ ____) | (__| | | | |_) | |_
| | |_____/ \___|_| |_| .__/ \__|
`-.._________..-' | |
|_|
CoffeeScript is a little language that compiles into JavaScript.
Installation
If you have the node package manager, npm, installed:
npm install -g coffee-script
Leave off the -g
if you don't wish to install globally. If you don't wish to use npm:
git clone https://github.com/jashkenas/coffeescript.git
sudo coffeescript/bin/cake install
Getting Started
Execute a script:
coffee /path/to/script.coffee
Compile a script:
coffee -c /path/to/script.coffee
For documentation, usage, and examples, see: http://coffeescript.org/
To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues
If you'd like to chat, drop by #coffeescript on Freenode IRC.
The source repository: https://github.com/jashkenas/coffeescript.git
Changelog: http://coffeescript.org/#changelog
Our lovely and talented contributors are listed here: http://github.com/jashkenas/coffeescript/contributors