Here you can find the source of flatMap(mapFunc)
Array.prototype.flatMap = function(mapFunc) { var result = [] for (let item of this) { let tokens = mapFunc(item)//w w w. j a v a 2 s .c o m result = result.concat(tokens) } return result }
Array.prototype.flatMap = function (cb) { return this.map(cb).reduce(function (arr, c) { return arr.concat(c); }, []); };
Array.prototype.flatMap = function(fn, ctx) { return this.reduce((k, v) => k.concat(fn.call(ctx, v)), []); };
Array.prototype.flatMap = function(lambda) { return Array.prototype.concat.apply([], this.map(lambda)); };
Array.prototype.flatMap = function(lambda) { return [].concat(this.map(lambda)); };
Array.prototype.flatMap = Array.prototype.flatMap || function(lambda) { return Array.prototype.concat.apply([], this.map(lambda));
Array.prototype.flatMap = function(projection) { return this. map(function(item) { return projection(item); }). mergeAll();