Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const countNotes: Function = (resultArr: Array<resultObject>): number => {
- if (!!resultArr && resultArr.length > 0) {
- return resultArr.reduce((acc, curr) => {
- if (typeof curr.count !== "undefined") {
- return acc += curr.count;
- }
- return acc;
- }, 0);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement