mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
documentation for pattern matching
This commit is contained in:
parent
186797a745
commit
c3029faca7
8 changed files with 202 additions and 16 deletions
11
documentation/js/multiple_return_values.js
Normal file
11
documentation/js/multiple_return_values.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
(function(){
|
||||
var __a, city, forecast, temp, weather_report;
|
||||
weather_report = function weather_report(location) {
|
||||
// Make an Ajax request to fetch the weather...
|
||||
return [location, 72, "Mostly Sunny"];
|
||||
};
|
||||
__a = weather_report("Berkeley, CA");
|
||||
city = __a[0];
|
||||
temp = __a[1];
|
||||
forecast = __a[2];
|
||||
})();
|
17
documentation/js/object_extraction.js
Normal file
17
documentation/js/object_extraction.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
(function(){
|
||||
var __a, __b, __c, city, futurists, poet, street;
|
||||
futurists = {
|
||||
sculptor: "Umberto Boccioni",
|
||||
painter: "Vladimir Burliuk",
|
||||
poet: {
|
||||
name: "F.T. Marinetti",
|
||||
address: ["Via Roma 42R", "Bellagio, Italy 22021"]
|
||||
}
|
||||
};
|
||||
__a = futurists;
|
||||
__b = __a.poet;
|
||||
poet = __b.name;
|
||||
__c = __b.address;
|
||||
street = __c[0];
|
||||
city = __c[1];
|
||||
})();
|
8
documentation/js/parallel_assignment.js
Normal file
8
documentation/js/parallel_assignment.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
(function(){
|
||||
var __a, and_switch, bait;
|
||||
bait = 1000;
|
||||
and_switch = 0;
|
||||
__a = [and_switch, bait];
|
||||
bait = __a[0];
|
||||
and_switch = __a[1];
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue