/documentation/coffee/splats.coffee

http://github.com/jashkenas/coffee-script · CoffeeScript · 25 lines · 21 code · 4 blank · 0 comment · 0 complexity · 32a81415b7c5c962b86471d0a711b0d6 MD5 · raw file

  1. gold = silver = rest = "unknown"
  2. awardMedals = (first, second, others...) ->
  3. gold = first
  4. silver = second
  5. rest = others
  6. contenders = [
  7. "Michael Phelps"
  8. "Liu Xiang"
  9. "Yao Ming"
  10. "Allyson Felix"
  11. "Shawn Johnson"
  12. "Roman Sebrle"
  13. "Guo Jingjing"
  14. "Tyson Gay"
  15. "Asafa Powell"
  16. "Usain Bolt"
  17. ]
  18. awardMedals contenders...
  19. alert "Gold: " + gold
  20. alert "Silver: " + silver
  21. alert "The Field: " + rest