Last active
October 4, 2015 02:07
-
-
Save julianlconnor/2559164 to your computer and use it in GitHub Desktop.
Sleep Deprived JS
This file contains hidden or 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
_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; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One of the sexiest code snippets I've ever seen.