Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Last active December 29, 2015 01:39
Show Gist options
  • Save westonplatter/7594941 to your computer and use it in GitHub Desktop.
Save westonplatter/7594941 to your computer and use it in GitHub Desktop.
x = 1
foo = ->
x = 2
return
foo()
var x=1;
var foo = function (){
var x=2; return;
};
foo();
x = 1
foo = ->
@x = 2
foo()
console.log x;
npm install -g coffee-script
coffee -c ./example.coffee
### compiled file
// Generated by CoffeeScript 1.6.3
(function() {
var foo, x;
x = 1;
foo = function() {
return x = 2;
};
foo();
console.log(x);
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment