Skip to content

Instantly share code, notes, and snippets.

@julianlconnor
Last active October 4, 2015 02:07
Show Gist options
  • Save julianlconnor/2559164 to your computer and use it in GitHub Desktop.
Save julianlconnor/2559164 to your computer and use it in GitHub Desktop.
Sleep Deprived JS
_this.raw_exchange.to_users = JSON.stringify(function() {
var obj = [];
_.each(targets, function(item) {
if ( item.get('active') ) {
if ( item.get('email') ) {
obj.push({email: item.get('email')});
} else {
obj.push({phone: item.get('phone')});
}
}
});
return obj;
}());
@angiep
Copy link

angiep commented Apr 30, 2012

One of the sexiest code snippets I've ever seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment