mirror of
https://github.com/flynx/object-run.js.git
synced 2025-10-28 18:40:07 +00:00
docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b1cc554262
commit
422967ffa4
14
README.md
14
README.md
@ -33,6 +33,20 @@ var o = {}
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var l = [1, 2, 3, 4, 5]
|
||||||
|
// keep only even elements...
|
||||||
|
.filter(function(e){
|
||||||
|
return e % 2 == 0 })
|
||||||
|
.sort()
|
||||||
|
// if length is not even add an extra even number at the end...
|
||||||
|
.run(function(){
|
||||||
|
this.length % 2 != 0
|
||||||
|
&& this.push(this[this.length-1] + 2) })
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user