Skip to content

Instantly share code, notes, and snippets.

View mike-duke's full-sized avatar

Mike Duke mike-duke

  • Denver, CO
View GitHub Profile

Missing Sheep

Consider an array of sheep where some sheep may be missing from their place. We need a function that returns the number of sheep present in the array (true means that this sheep is present).

var sheep = [
  true, true, true, false,
  true, true, true, true,
  true, false, true, false,
 true, false, false, true,