PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/documentation/js/splats.js

http://github.com/jashkenas/coffee-script
JavaScript | 23 lines | 15 code | 7 blank | 1 comment | 0 complexity | 3263f2f83d0156c4d120e881556ed207 MD5 | raw file
 1// Generated by CoffeeScript 1.10.0
 2var awardMedals, contenders, gold, rest, silver,
 3  slice = [].slice;
 4
 5gold = silver = rest = "unknown";
 6
 7awardMedals = function() {
 8  var first, others, second;
 9  first = arguments[0], second = arguments[1], others = 3 <= arguments.length ? slice.call(arguments, 2) : [];
10  gold = first;
11  silver = second;
12  return rest = others;
13};
14
15contenders = ["Michael Phelps", "Liu Xiang", "Yao Ming", "Allyson Felix", "Shawn Johnson", "Roman Sebrle", "Guo Jingjing", "Tyson Gay", "Asafa Powell", "Usain Bolt"];
16
17awardMedals.apply(null, contenders);
18
19alert("Gold: " + gold);
20
21alert("Silver: " + silver);
22
23alert("The Field: " + rest);