Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
submission report
Commit Description:
submission report
var aFunction = require ( './_a-function' );
var toObject = require ( './_to-object' );
var IObject = require ( './_iobject' );
var toLength = require ( './_to-length' );
module . exports = function ( that , callbackfn , aLen , memo , isRight ) {
aFunction ( callbackfn );
var O = toObject ( that );
var self = IObject ( O );
var length = toLength ( O . length );
var index = isRight ? length - 1 : 0 ;
var i = isRight ? - 1 : 1 ;
if ( aLen < 2 ) for (;;) {
if ( index in self ) {
memo = self [ index ];
index += i ;
break ;
}
index += i ;
if ( isRight ? index < 0 : length <= index ) {
throw TypeError ( 'Reduce of empty array with no initial value' );
}
}
for (; isRight ? index >= 0 : length > index ; index += i ) if ( index in self ) {
memo = callbackfn ( memo , self [ index ], index , O );
}
return memo ;
};
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings