Simplify doc examples that use Math methods. [ci skip]

This commit is contained in:
John-David Dalton
2015-09-10 19:07:37 -07:00
parent 5ddb1ef76d
commit 5c98ab4b8f

View File

@@ -5400,9 +5400,7 @@
* @returns {Array} Returns the new duplicate free array. * @returns {Array} Returns the new duplicate free array.
* @example * @example
* *
* _.sortedUniqBy([1, 1.5, 2, 2.5], function(n) { * _.sortedUniqBy([1, 1.5, 2, 2.5], Math.floor);
* return Math.floor(n);
* });
* // => [1, 2] * // => [1, 2]
*/ */
function sortedUniqBy(array, iteratee) { function sortedUniqBy(array, iteratee) {
@@ -5615,9 +5613,7 @@
* @returns {Array} Returns the new duplicate free array. * @returns {Array} Returns the new duplicate free array.
* @example * @example
* *
* _.uniqBy([1, 2.5, 1.5, 2], function(n) { * _.uniqBy([1, 2.5, 1.5, 2], Math.floor);
* return Math.floor(n);
* });
* // => [1, 2.5] * // => [1, 2.5]
* *
* // using the `_.property` callback shorthand * // using the `_.property` callback shorthand
@@ -6061,15 +6057,14 @@
* @returns {Object} Returns the new `lodash` wrapper instance. * @returns {Object} Returns the new `lodash` wrapper instance.
* @example * @example
* *
* var array = [1, 2]; * function square(n) {
* var wrapped = _(array).map(function(value) { * return n * n;
* return Math.pow(value, 2); * }
* });
* *
* var other = [3, 4]; * var wrapped = _([1, 2]).map(square);
* var otherWrapped = wrapped.plant(other); * var other = wrapped.plant([3, 4]);
* *
* otherWrapped.value(); * other.value();
* // => [9, 16] * // => [9, 16]
* *
* wrapped.value(); * wrapped.value();
@@ -6182,9 +6177,7 @@
* @returns {Object} Returns the composed aggregate object. * @returns {Object} Returns the composed aggregate object.
* @example * @example
* *
* _.countBy([4.3, 6.1, 6.4], function(n) { * _.countBy([4.3, 6.1, 6.4], Math.floor);
* return Math.floor(n);
* });
* // => { '4': 1, '6': 2 } * // => { '4': 1, '6': 2 }
* *
* _.countBy(['one', 'two', 'three'], 'length'); * _.countBy(['one', 'two', 'three'], 'length');
@@ -6418,9 +6411,7 @@
* @returns {Object} Returns the composed aggregate object. * @returns {Object} Returns the composed aggregate object.
* @example * @example
* *
* _.groupBy([4.2, 6.1, 6.4], function(n) { * _.groupBy([4.2, 6.1, 6.4], Math.floor);
* return Math.floor(n);
* });
* // => { '4': [4.2], '6': [6.1, 6.4] } * // => { '4': [4.2], '6': [6.1, 6.4] }
* *
* // using the `_.property` callback shorthand * // using the `_.property` callback shorthand