Cleanup doc examples for lodash and _.map. [ci skip]

This commit is contained in:
John-David Dalton
2015-09-23 22:44:53 -07:00
parent 5026f51dfd
commit 0429f27c54

View File

@@ -1474,18 +1474,18 @@
* @returns {Object} Returns the new `lodash` wrapper instance. * @returns {Object} Returns the new `lodash` wrapper instance.
* @example * @example
* *
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]); * var wrapped = _([1, 2, 3]);
* *
* // returns an unwrapped value * // returns an unwrapped value
* wrapped.reduce(function(sum, n) { * wrapped.reduce(_.add);
* return sum + n;
* });
* // => 6 * // => 6
* *
* // returns a wrapped value * // returns a wrapped value
* var squares = wrapped.map(function(n) { * var squares = wrapped.map(square);
* return n * n;
* });
* *
* _.isArray(squares); * _.isArray(squares);
* // => false * // => false
@@ -6605,14 +6605,14 @@
* @returns {Array} Returns the new mapped array. * @returns {Array} Returns the new mapped array.
* @example * @example
* *
* function timesThree(n) { * function square(n) {
* return n * 3; * return n * n;
* } * }
* *
* _.map([1, 2], timesThree); * _.map([1, 2], square);
* // => [3, 6] * // => [3, 6]
* *
* _.map({ 'a': 1, 'b': 2 }, timesThree); * _.map({ 'a': 1, 'b': 2 }, square);
* // => [3, 6] (iteration order is not guaranteed) * // => [3, 6] (iteration order is not guaranteed)
* *
* var users = [ * var users = [