Skip to content
This repository
Browse code

fixed a #

  • Loading branch information...
commit fc556d62f67e2edd8d8f936e08380249aa072430 1 parent 4ab9fed
Reg Braithwaite authored December 20, 2012

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  2012/12/end_of_days_ellipses.md
6  2012/12/end_of_days_ellipses.md
Source Rendered
@@ -2,7 +2,9 @@
2 2
 
3 3
 *This kind of thing normally wouldn't merit a full blog post all by itself, but just in case today really is the end of the world, I'm taking no chances and sharing the idea while I can.*
4 4
 
5  
-The CoffeeScript programming language has a useful feature: If a parameter of a method is written with trailing ellipses, it collects a list of parameters into an array. It can be used in various ways, and the CoffeeScript transpiler does some pattern matching to sort things out, but 80% of the use is to collect a variable number of arguments without using the `arguments` pseudo-variable, and 19% of the uses are to collect a trailing list of arguments. Here's what it looks like collecting a variable number of arguments and trailing arguments:
  5
+The CoffeeScript programming language has a useful feature: If a parameter of a method is written with trailing ellipses, it collects a list of parameters into an array. It can be used in various ways, and the CoffeeScript transpiler does some pattern matching to sort things out, but 80% of the use is to collect a variable number of arguments without using the `arguments` pseudo-variable, and 19% of the uses are to collect a trailing list of arguments.
  6
+
  7
+Here's what it looks like collecting a variable number of arguments and trailing arguments:
6 8
 
7 9
 ```coffeescript
8 10
 leftPartial = (fn, args...) ->
@@ -100,7 +102,7 @@ mapper(function (x) { return x * x }, 1, 2, 3)
100 102
 var squarer = leftPartial(mapper, function (x) { return x * x });
101 103
 
102 104
 squarer(1, 2, 3)
103  
-  #=> [1, 4, 9]
  105
+  //=> [1, 4, 9]
104 106
 ```
105 107
 
106 108
 Works like a charm! So what have we seen?

0 notes on commit fc556d6

Please sign in to comment.
Something went wrong with that request. Please try again.