Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function visitedSum(book,page){
- var sum = 0;
- Object.keys(historybook[book]).forEach(page => {
- sum += historybook[book][page];
- });
- return sum;
- }
- function visitedCount(book,page){
- var count = 0;
- Object.keys(historybook[book]).forEach(page => {
- if ( historybook[book][page] > 0 ) {
- count += 1;
- }
- });
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement