Basic Nim game vs computer in JavaScript
I stumbled across this because a friend told me he got hit with this question recently for a coding bootcamp entrance exam. I had to look and see what it is, of course : )

Josh has a great answer with excellent use of higher order functions and keeping things DRY. At a glance, one change that I'd make with his code is the usage of the reduce function. It's a bit verbose and possibly difficult for a beginner to parse through. A clearer declaration would be using something like Array.every (once all the circles return an empty string "", the GameOver function returns true). It's a tiny gripe, but it's more intuitive. The usage would be substituted like this:

function isGameOver() {
  return piles.every(function(pile) {
    return pile.circles === "";
  });
}