How to use the partitionBy function from lodash

Find comprehensive JavaScript lodash.partitionBy code examples handpicked from public code repositorys.

295
296
297
298
299
300
301
302
303
304
module.exports.padStart            = _.padStart;
module.exports.parseInt            = _.parseInt;
module.exports.partial             = _.partial;
module.exports.partialRight        = _.partialRight;
module.exports.partition           = _.partition;
module.exports.partitionBy         = _.partitionBy;
module.exports.pick                = _.pick;
module.exports.pickBy              = _.pickBy;
module.exports.pickWhen            = _.pickWhen;
module.exports.pipeline            = _.pipeline;
fork icon19
star icon122
watch icon0

+ 92 other calls in file

4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
  var fstVal = fun(fst);
  var run    = concat.call([fst], _.takeWhile(_.rest(array), function(e) {
    return _.isEqual(fstVal, fun(e));
  }));

  return concat.call([run], _.partitionBy(_.drop(array, _.size(run)), fun));
},

// Returns the 'best' value in an array based on the result of a
// given function.
fork icon3
star icon2
watch icon1

+ 58 other calls in file

Other functions in lodash

Sorted by popularity

function icon

lodash.get is the most popular function in lodash (7670 examples)