src/js/maps.js
/**
* Fold function for maps / Objects
* @param {Function} Fun(Key,Value,Acc) -> Acc
* @param {Object} Acc Accumulated Value
* @param {Map/Object} Map a map of Key Value pairs
* @return {Object} Accumulated Value
*/
Fold function for maps / Objects
Fold function for maps / Objects
function fold(Fun,Acc,Map) {
  var i, Keys = Object.keys(Map)
  for (i = 0; i < Keys.length; i++) {
    Acc = Fun(Keys[i],Map[Keys[i]],Acc);
  }
  return Acc;
}
function fold ( Fun , Acc , Map ) { var i , Keys = Object . keys ( Map ) for ( i = 0 ; i < Keys . length ; i ++ ) { Acc = Fun ( Keys [ i ] , Map [ Keys [ i ] ] , Acc ) ; } return Acc ; }
Fold function for maps / Objects
Fold function for maps / Objects