Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let totalAKHP;
  2. let totalPresc;
  3.  
  4. if(data.akhp) {
  5.     totalAKHP = data.akhp.reduce(prev, curr => prev + curr.totalFee, 0);
  6. }
  7. if(data.prescription) {
  8.     totalPresc = data.prescription.reduce(prev, curr => prev + curr.totalFee, 0);
  9. }
  10.  
  11. const total = totalAKHP + totalPresc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement