Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. export const countNotes: Function = (resultArr: Array<resultObject>): number => {
  2. if (!!resultArr && resultArr.length > 0) {
  3. return resultArr.reduce((acc, curr) => {
  4. if (typeof curr.count !== "undefined") {
  5. return acc += curr.count;
  6. }
  7. return acc;
  8. }, 0);
  9. }
  10. return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement