1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/documentation/js/splats.js

18 lines
655 B
JavaScript
Raw Normal View History

2010-01-04 23:26:27 -05:00
(function(){
2010-01-26 23:23:59 -05:00
var award_medals, contenders, gold, silver, the_field;
2010-01-17 18:12:59 -05:00
gold = (silver = (the_field = "unknown"));
2010-01-26 23:23:59 -05:00
award_medals = function award_medals(first, second) {
2010-01-04 23:26:27 -05:00
var rest;
2010-03-23 00:18:50 -04:00
rest = Array.prototype.slice.call(arguments, 2, arguments.length - 0);
2010-01-04 23:26:27 -05:00
gold = first;
silver = second;
2010-03-23 00:18:50 -04:00
the_field = rest;
return the_field;
2010-01-04 23:26:27 -05:00
};
contenders = ["Michael Phelps", "Liu Xiang", "Yao Ming", "Allyson Felix", "Shawn Johnson", "Roman Sebrle", "Guo Jingjing", "Tyson Gay", "Asafa Powell", "Usain Bolt"];
2010-01-26 23:23:59 -05:00
award_medals.apply(this, contenders);
2010-01-04 23:26:27 -05:00
alert("Gold: " + gold);
alert("Silver: " + silver);
alert("The Field: " + the_field);
2010-02-24 18:27:10 -05:00
})();