Skip to content

Instantly share code, notes, and snippets.

@adinardi
Forked from ekosz/gist:957403
Created May 5, 2011 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adinardi/957462 to your computer and use it in GitHub Desktop.
Save adinardi/957462 to your computer and use it in GitHub Desktop.
Coffee Script vs. Javascript
JAVASCRIPT
==========
client.send({
otherClients: (function() {
var _results = [];
for (var _i = 0, c; c = clients[_i]; _i++) {
if (c !== client) {
_results.push(nameHash[c]);
}
}
return _results;
}
);
COFFEE SCRIPT
=============
client.send { otherClients: nameHash[c] for c in clients when c != client }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment