Created
September 20, 2016 14:56
-
-
Save neufeldtech/5914a0814c954f78b6acceab29bb4db1 to your computer and use it in GitHub Desktop.
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
http://stackoverflow.com/questions/8965855/coffeescript-when-to-use-fat-arrow-over-arrow-and-vice-versa | |
Yo yo, this might help understanding the @ symbol and fat and skinny arrows. | |
Notice that the context of the @ symbol is inside a class. | |
Notice that the context of the fat vs skinny arrows are when dealing with callbacks. | |
class Test | |
constructor: -> | |
@canvas = document.createElement 'canvas' | |
window.addEventListener 'resize', -> | |
@canvas.width = window.innerWidth | |
@canvas.height = window.innerHeight | |
works: (@canvas defined) | |
class Test | |
constructor: -> | |
@canvas = document.createElement 'canvas' | |
window.addEventListener 'resize', => | |
@canvas.width = window.innerWidth | |
@canvas.height = window.innerHeight |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment