Skip to content

Instantly share code, notes, and snippets.

@polotek
Created June 28, 2011 19:57
Show Gist options
  • Select an option

  • Save polotek/1052033 to your computer and use it in GitHub Desktop.

Select an option

Save polotek/1052033 to your computer and use it in GitHub Desktop.
Some coffeescript syntax experimenting. How are these different?
baz = -> alert 'baz'
foo -> alert 'foo'
bar ->
foo
baz = ->
foo = -> alert 'new foo'
baz()
foo()
foo()
baz()
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