Skip to content

Commit

Permalink
adaptive function arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kemsky committed Feb 15, 2016
1 parent 04043bc commit 22812a0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,18 @@ s.forEach(function(item:Number):void
{
trace(item);
});
//or
s.forEach(function(item:Number, index:uint):void
{
trace(item);
});
//or
s.forEach(function(item:Number, index:uint, stream:Stream):void
{
trace(item);
});
//prints 1, 2, 3
```
*Notice that callback does not have `index:uint` and `array:Array` parameters -
it is one of the differences between Array and Stream APIs, it is more suitable for functional programming.*

## foldLeft, foldRight methods

Expand Down

0 comments on commit 22812a0

Please sign in to comment.