mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +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
|
#### Example
|
||||||
```js
|
```js
|
||||||
_.chain([1, 2, 3, 200])
|
_([1, 2, 3, 4])
|
||||||
.filter(function(num) { return num % 2 == 0; })
|
.filter(function(num) { return num % 2 == 0; })
|
||||||
.tap(alert)
|
.tap(alert)
|
||||||
.map(function(num) { return num * num; })
|
.map(function(num) { return num * num; })
|
||||||
.value();
|
.value();
|
||||||
// => // [2, 200] (alerted)
|
// => // [2, 4] (alerted)
|
||||||
// => [4, 40000]
|
// => [4, 16]
|
||||||
```
|
```
|
||||||
|
|
||||||
* * *
|
* * *
|
||||||
|
|||||||
@@ -4230,13 +4230,13 @@
|
|||||||
* @returns {Mixed} Returns `value`.
|
* @returns {Mixed} Returns `value`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.chain([1, 2, 3, 200])
|
* _([1, 2, 3, 4])
|
||||||
* .filter(function(num) { return num % 2 == 0; })
|
* .filter(function(num) { return num % 2 == 0; })
|
||||||
* .tap(alert)
|
* .tap(alert)
|
||||||
* .map(function(num) { return num * num; })
|
* .map(function(num) { return num * num; })
|
||||||
* .value();
|
* .value();
|
||||||
* // => // [2, 200] (alerted)
|
* // => // [2, 4] (alerted)
|
||||||
* // => [4, 40000]
|
* // => [4, 16]
|
||||||
*/
|
*/
|
||||||
function tap(value, interceptor) {
|
function tap(value, interceptor) {
|
||||||
interceptor(value);
|
interceptor(value);
|
||||||
|
|||||||
@@ -3633,13 +3633,13 @@
|
|||||||
* @returns {Mixed} Returns `value`.
|
* @returns {Mixed} Returns `value`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.chain([1, 2, 3, 200])
|
* _([1, 2, 3, 4])
|
||||||
* .filter(function(num) { return num % 2 == 0; })
|
* .filter(function(num) { return num % 2 == 0; })
|
||||||
* .tap(alert)
|
* .tap(alert)
|
||||||
* .map(function(num) { return num * num; })
|
* .map(function(num) { return num * num; })
|
||||||
* .value();
|
* .value();
|
||||||
* // => // [2, 200] (alerted)
|
* // => // [2, 4] (alerted)
|
||||||
* // => [4, 40000]
|
* // => [4, 16]
|
||||||
*/
|
*/
|
||||||
function tap(value, interceptor) {
|
function tap(value, interceptor) {
|
||||||
interceptor(value);
|
interceptor(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user