Last active
August 29, 2015 13:57
-
-
Save caillou/9758270 to your computer and use it in GitHub Desktop.
CoffeeScript is mad!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(-> | |
x = -> | |
foo = false | |
# If a variable is used after a function definition | |
# for the first time... | |
foo = true | |
)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var foo, x; | |
x = function() { | |
// ... CoffeeScript adds a var keyword. | |
var foo; | |
return foo = false; | |
}; | |
return foo = true; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(-> | |
# If a variable is used before a function definition | |
# for the first time... | |
foo = true | |
x = -> | |
foo = false | |
)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var foo, x; | |
foo = true; | |
return x = function() { | |
// ... it doesn't add the var keyword | |
return foo = false; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment