Skip to content

Instantly share code, notes, and snippets.

@ayende
Created August 26, 2017 11:21
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 ayende/6ea9a048efbd34f8aa2b09bb347be200 to your computer and use it in GitHub Desktop.
Save ayende/6ea9a048efbd34f8aa2b09bb347be200 to your computer and use it in GitHub Desktop.
select {
Nick: d.Nick,
FirstName: d.FirstName,
LastName: d.LastName
}
select {
Name: d.FirstName + " " + d.LastName,
Nick: d.Nick,
Votes: d.PlusVotes - d.NegativeVotes
}
select {
Name: (function(d) {
if (d.Nick != null)
return d.Nick;
return d.FirstName + " " + d.LastName;
})(d),
Votes: d.PlusVotes - d.NegativeVotes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment