Created
June 28, 2011 19:57
-
-
Save polotek/1052033 to your computer and use it in GitHub Desktop.
Some coffeescript syntax experimenting. How are these different?
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
| baz = -> alert 'baz' | |
| foo -> alert 'foo' | |
| bar -> | |
| foo | |
| baz = -> | |
| foo = -> alert 'new foo' | |
| baz() | |
| foo() | |
| foo() | |
| baz() |
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
| var baz = function() { | |
| alert('baz'); | |
| } | |
| function foo() { | |
| alert('foo'); | |
| } | |
| function bar() { | |
| var foo; | |
| var baz = function() { | |
| foo = function() { | |
| alert('new foo'); | |
| } | |
| } | |
| baz(); | |
| foo(); | |
| } | |
| foo() | |
| baz(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment