mirror of
https://github.com/flynx/object-run.js.git
synced 2025-10-29 02:50:08 +00:00
docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
422967ffa4
commit
6a5bf2cddb
21
README.md
21
README.md
@ -1,16 +1,16 @@
|
|||||||
# object-run.js
|
# object-run.js
|
||||||
|
|
||||||
|
`object-run.js` implements the tools needed to use the [Concatinative
|
||||||
|
Programming Style](https://en.wikipedia.org/wiki/Concatenative_programming_language)
|
||||||
|
on native JavaScript structures/objects.
|
||||||
|
|
||||||
This module defines a singe method `.run(..)` on `Object.prototype` making
|
This module defines a singe method `.run(..)` on `Object.prototype` making
|
||||||
it visible from all JavaScript objects inheriting from Object.
|
it visible from all JavaScript objects inheriting from `Object`.
|
||||||
|
|
||||||
The `.run(..)` method simply executes a function in the context of object
|
The `.run(..)` method simply executes a function in the context of the
|
||||||
from which `.run(..)` was called.
|
object from which `.run(..)` was called. The return value of `.run(..)`
|
||||||
|
is the non-`undefined` return value of the passed function or the context
|
||||||
The return value of `.run(..)` is the non-`undefined` return value of the
|
object otherwise.
|
||||||
passed function.
|
|
||||||
|
|
||||||
The use of `.run(..)` enables the concatinative programming style on any
|
|
||||||
JavaScript structure/object.
|
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@ -65,6 +65,9 @@ var l = [1, 2, 3, 4, 5]
|
|||||||
-> <return-value>
|
-> <return-value>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If `<func>()` returns `undefined` then `.run(..)` will return `<obj>`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user