SHARE
TWEET

Untitled

a guest Sep 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top