jashkenas--coffeescript/documentation/js/multiple_return_values.js

12 lines
313 B
JavaScript
Raw Normal View History

2010-01-12 03:55:01 +00:00
(function(){
2010-02-21 16:45:03 +00:00
var _a, city, forecast, temp, weather_report;
2010-01-12 03:55:01 +00:00
weather_report = function weather_report(location) {
// Make an Ajax request to fetch the weather...
return [location, 72, "Mostly Sunny"];
};
2010-02-21 16:45:03 +00:00
_a = weather_report("Berkeley, CA");
city = _a[0];
temp = _a[1];
forecast = _a[2];
2010-02-24 23:27:10 +00:00
})();