SHARE
TWEET

Untitled

a guest Jun 17th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [{
  2.     createdAt: "2019-06-17T06:56:37.765Z",
  3.     id: "2eaa85f8-6116-4763-8927-2f17b855345b",
  4.     jenis: "Tools HAHA",
  5.     lifetime: 100,
  6.     process: [
  7.         {
  8.             ct: "10",
  9.             jenis: "Makino",
  10.             type: "machine"
  11.         },
  12.         {
  13.             ct: "15",
  14.             jenis: "Makino",
  15.             type: "machine"
  16.         }
  17.     ]
  18. },
  19. {
  20.     createdAt: "2019-06-17T06:56:37.765Z",
  21.     id: "2eaa85f8-6116-4763-8927-2f17b855345b",
  22.     jenis: "Tools CKCK",
  23.     lifetime: 99,
  24.     process: [
  25.         {
  26.             ct: "9",
  27.             jenis: "Makino",
  28.             type: "machine"
  29.         },
  30.         {
  31.             ct: "9",
  32.             jenis: "Makino",
  33.             type: "machine"
  34.         }
  35.     ]
  36. }]
  37.  
  38. jenis.map((data, index) => {
  39.     let ct = data.process.reduce((acc, val) => {
  40.         return parseInt(acc.ct) + parseInt(v.ct);
  41.     });
  42.     data.CT = ct;
  43.     return data;
  44. })
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top