Version: 0.1.00.2.00.2.10.2.20.3.00.3.10.3.20.4.00.4.10.4.20.5.0-rc.10.5.00.5.10.5.20.6.00.6.10.7.00.8.00.8.10.8.20.9.00.9.10.9.20.10.01.0.0-rc.11.0.0-rc.21.0.0-rc.31.0.01.0.11.0.21.1.01.1.11.2.01.2.11.3.01.3.12.0.02.1.02.2.02.2.12.3.02.4.02.4.12.4.23.0.03.0.13.1.03.2.03.3.03.3.13.4.03.5.03.6.03.7.03.8.03.9.03.9.13.9.23.9.33.10.03.10.14.0.04.0.14.1.04.2.04.2.14.3.04.4.04.5.04.5.14.6.04.6.14.7.04.8.04.8.14.8.24.9.04.10.04.11.04.11.14.11.24.12.04.13.04.13.14.14.04.14.14.14.24.15.04.16.04.16.14.16.24.16.34.16.44.16.54.16.64.17.04.17.14.17.24.17.34.17.44.17.54.17.94.17.104.17.114.17.124.17.134.17.144.17.154.17.164.17.174.17.184.17.194.17.204.17.21
var baseFlatten = require('./_baseFlatten'),
map = require('./map');
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
* function duplicate(n) {
* return [n, n];
* }
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
module.exports = flatMap;