We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I suggest to add some general counting functions into lib, which is useful with methods like partitionBy, #map, ...
partitionBy
function plus_if( fn, init ){ var v = init || 0; return function( ){ return v += fn.apply( null, arguments ); } }
It can be use like this:
var barriers = [ 1, 0, 0, 1, 0, 1, 1, 0, 0, 0 ]; sections = _.partitionBy( barriers, plus_if( _.identity ) ); // => [ [ 1, 0, 0 ], [ 1, 0 ], [ 1 ], [ 1, 0, 0, 0 ] ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I suggest to add some general counting functions into lib, which is useful with methods like
partitionBy
, #map, ...It can be use like this:
The text was updated successfully, but these errors were encountered: