Skip to content

Commit 9533e60

Browse files
David Bradysreid
authored andcommitted
Added arrays/list-comprehensions and arrays/mapping-arrays
1 parent da9f902 commit 9533e60

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

wanted-recipes.textile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ h2. Syntax
1212

1313
* loops: for x in [1..10]
1414
* loops: for x in [1..10] then do_one_thing
15-
* list comprehensions: y*3 for y in (x*2 for x in [1,2,3]) # => [6, 12, 18]
16-
* maps: Previous line might be better represented as ([1,2,3].map (x) -> x*2).map (y) -> y*3
1715
* list comp gotcha: y = x for x in [1..3]; y # => 3; but y = (x for x in [1..3]); y # => [ 1, 2, 3 ]
1816
* Ensuring variables are closed over # with "do"
1917

@@ -35,7 +33,6 @@ h2. Strings
3533
h2. Arrays
3634

3735
* Using Arrays to Swap Variables # [x,y] = [y,x]
38-
* Mapping arrays to other arrays with map # [1,2,3].map (x) -> x*2 # => [2, 4, 6]
3936
* Reducing arrays to values (ruby inject) with reduce # [1..10].reduce (a,b) -> a+b # 55
4037
* Reducing arrays in reverse order # JS reduceRight
4138
{% highlight coffeescript %}

0 commit comments

Comments
 (0)