Skip to content

Instantly share code, notes, and snippets.

@ChrisWhealy
Created April 28, 2016 15:51
Show Gist options
  • Save ChrisWhealy/80e5d02f76a96d94d35abc19f5545f99 to your computer and use it in GitHub Desktop.
Save ChrisWhealy/80e5d02f76a96d94d35abc19f5545f99 to your computer and use it in GitHub Desktop.
Mindshift: Part 3, sample 8
var naughty_and_nice = kids.reduce((acc,k) => {
acc.nice += !k.isNaughty;
acc.naughty += k.isNaughty;
return acc;
}, {naughty:0, nice:0});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment