Created
October 8, 2011 21:43
-
-
Save mverzilli/1272923 to your computer and use it in GitHub Desktop.
CoffeeScript vs. Javascript array population
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
JavaScript: | |
var data = [] | |
for (var i = 0; i < 84; i++) { | |
data.push(i * 10 / 84); | |
} | |
CoffeeScript: | |
data = (i * 10 / 84 for i in [0..83]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment