Skip to content

Instantly share code, notes, and snippets.

@ignu
Last active December 17, 2015 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ignu/5685418 to your computer and use it in GitHub Desktop.
Save ignu/5685418 to your computer and use it in GitHub Desktop.
1) you don't need the var keyword. all variables will be protected from the global scope.
2) functions automatically return the last line, called an "explicit return"
3) functions are the funkiest looking but really simple. they look like this:
(obj) -> "this is my #{obj}"
instead of:
function(obj) {
return "this is my " + obj);
};
4) you don't need to bind things. you can just declare a function with a fat arrow and it will maintain what "this" is.
5) whitespace is significant. you can declare an object like this
events:
"something" : "yeah"
"here" " "there"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment