mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Correct _#tap doc example. [closes #156]
Former-commit-id: d1f6982e824a97db73546b8594c074b735580f8e
This commit is contained in:
@@ -729,13 +729,13 @@ Invokes `interceptor` with the `value` as the first argument, and then returns `
|
||||
|
||||
#### Example
|
||||
```js
|
||||
_.chain([1, 2, 3, 200])
|
||||
_([1, 2, 3, 4])
|
||||
.filter(function(num) { return num % 2 == 0; })
|
||||
.tap(alert)
|
||||
.map(function(num) { return num * num; })
|
||||
.value();
|
||||
// => // [2, 200] (alerted)
|
||||
// => [4, 40000]
|
||||
// => // [2, 4] (alerted)
|
||||
// => [4, 16]
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
@@ -4230,13 +4230,13 @@
|
||||
* @returns {Mixed} Returns `value`.
|
||||
* @example
|
||||
*
|
||||
* _.chain([1, 2, 3, 200])
|
||||
* _([1, 2, 3, 4])
|
||||
* .filter(function(num) { return num % 2 == 0; })
|
||||
* .tap(alert)
|
||||
* .map(function(num) { return num * num; })
|
||||
* .value();
|
||||
* // => // [2, 200] (alerted)
|
||||
* // => [4, 40000]
|
||||
* // => // [2, 4] (alerted)
|
||||
* // => [4, 16]
|
||||
*/
|
||||
function tap(value, interceptor) {
|
||||
interceptor(value);
|
||||
|
||||
@@ -3633,13 +3633,13 @@
|
||||
* @returns {Mixed} Returns `value`.
|
||||
* @example
|
||||
*
|
||||
* _.chain([1, 2, 3, 200])
|
||||
* _([1, 2, 3, 4])
|
||||
* .filter(function(num) { return num % 2 == 0; })
|
||||
* .tap(alert)
|
||||
* .map(function(num) { return num * num; })
|
||||
* .value();
|
||||
* // => // [2, 200] (alerted)
|
||||
* // => [4, 40000]
|
||||
* // => // [2, 4] (alerted)
|
||||
* // => [4, 16]
|
||||
*/
|
||||
function tap(value, interceptor) {
|
||||
interceptor(value);
|
||||
|
||||
Reference in New Issue
Block a user