Skip to content

Instantly share code, notes, and snippets.

@ekosz
Created May 5, 2011 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ekosz/957403 to your computer and use it in GitHub Desktop.
Save ekosz/957403 to your computer and use it in GitHub Desktop.
Coffee Script vs. Javascript
JAVASCRIPT
==========
var c;
client.send({
otherClients: (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = clients.length; _i < _len; _i++) {
c = clients[_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