mirror of
https://github.com/flynx/object-run.js.git
synced 2025-10-28 10:30: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` 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
|
||||
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
|
||||
from which `.run(..)` was called.
|
||||
|
||||
The return value of `.run(..)` is the non-`undefined` return value of the
|
||||
passed function.
|
||||
|
||||
The use of `.run(..)` enables the concatinative programming style on any
|
||||
JavaScript structure/object.
|
||||
The `.run(..)` method simply executes a function in the context of the
|
||||
object from which `.run(..)` was called. The return value of `.run(..)`
|
||||
is the non-`undefined` return value of the passed function or the context
|
||||
object otherwise.
|
||||
|
||||
|
||||
## Installation
|
||||
@ -65,6 +65,9 @@ var l = [1, 2, 3, 4, 5]
|
||||
-> <return-value>
|
||||
```
|
||||
|
||||
If `<func>()` returns `undefined` then `.run(..)` will return `<obj>`.
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user