Correct _#tap doc example. [closes #156]

Former-commit-id: d1f6982e824a97db73546b8594c074b735580f8e
This commit is contained in:
John-David Dalton
2013-01-08 22:21:38 -08:00
parent 4e631c9e8f
commit fb9d4303f1
3 changed files with 9 additions and 9 deletions

View File

@@ -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]
``` ```
* * * * * *

View File

@@ -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);

View File

@@ -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);