Created
April 23, 2012 16:23
-
-
Save davidjbeveridge/2472058 to your computer and use it in GitHub Desktop.
My Coffee Script test. I am trying to figure out what is wrong with my scoping to make it not increment.
This file contains 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
jQuery -> | |
count = 0 | |
$("a").click (e) -> | |
e.preventDefault() | |
alert("Hello World #{++count}") |
This file contains 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
jQuery(function() { | |
var count; | |
count = 0; | |
return $("a").click(function(e) { | |
e.preventDefault(); | |
return alert("Hello World " + (++count)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment