Guest User

Untitled

a guest
Apr 11th, 2018
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. var contacts = [
  2. "8e010f59181f4a588fc4383c61a53a30",
  3. "3a57f0bcdb644615a922059689350da9",
  4. "f2fc2ec188cf40d481961abeb0817233",
  5. "6357e76c199c43e396b9edb1be41781e",
  6. "4a41a34a9124432aae1f64b4aa2a73c8",
  7. "4bc07194ccc24391946cd67ac4d23f05",
  8. "c36c169d5b85464ab0060edda1a67a90",
  9. "480b195e976e4b57ab0cf4bd1a79eb4f",
  10. "85e6aa639c6441dcb2ba5503cad106d2",
  11. "8de7e148a8b24b12bab1532a3e523b94",
  12. "bb291d8588824a468b0e4d83d8062000",
  13. "e9221bb8de8e43cbb1efb2fbd2112ab5",
  14. "f408b2b8c9bc4a84a6beff7df301040e",
  15. "a464edcb412243aebbf7591ab32c9100",
  16. "199acdb86d474b72b81927f35b2c8dc8",
  17. "f9ab3d6b248c4aa48998a1c5e0390285",
  18. "08b7168546f64668a02f1b12c9a47aff"
  19. ]
  20.  
  21. var contactsJSON = [
  22. {
  23. "id": 0,
  24. "firstName": "Suzy",
  25. "lastName": "Hollifield",
  26. "email": "suzy.hollifield@chubb.com",
  27. "phoneNumber": "",
  28. "states": ["AL", "GA", "LA"]
  29. },
  30. {
  31. "id": 1,
  32. "firstName": "Matt",
  33. "lastName": "Brodsky",
  34. "email": "matthew.brodsky@chubb.com",
  35. "phoneNumber": "",
  36. "states": ["AL", "CO", "HI", "OK", "UT", "WY"]
  37. },
  38. {
  39. "id": 2,
  40. "firstName": "Connie",
  41. "lastName": "Taylor",
  42. "email": "connie.taylor@chubb.com",
  43. "phoneNumber": "",
  44. "states": ["AZ", "CA", "NM", "NV"]
  45. },
  46. {
  47. "id": 3,
  48. "firstName": "Jim",
  49. "lastName": "Hennessy",
  50. "email": "james.hennessy@chubb.com",
  51. "phoneNumber": "",
  52. "states": ["AR", "IL", "KS", "MI", "MS", "MO", "WI"]
  53. },
  54. {
  55. "id": 4,
  56. "firstName": "Josh",
  57. "lastName": "Gibbons",
  58. "email": "joshua.gibbons@chubb.com",
  59. "phoneNumber": "",
  60. "states": ["CT", "MA", "NH", "RI", "VT"]
  61. },
  62. {
  63. "id": 5,
  64. "firstName": "Jeffrey",
  65. "lastName": "Dietrich",
  66. "email": "jdietrich@chubb.com",
  67. "phoneNumber": "",
  68. "states": ["DE", "MD", "DC"]
  69. },
  70. {
  71. "id": 6,
  72. "firstName": "Nicole",
  73. "lastName": "Troxell",
  74. "email": "ytroxell@chubb.com",
  75. "phoneNumber": "",
  76. "states": ["Florida"]
  77. },
  78. {
  79. "id": 7,
  80. "firstName": "Ryan",
  81. "lastName": "Vette",
  82. "email": "ryan.vette@chubb.com",
  83. "phoneNumber": "",
  84. "states": ["GA", "NC", "TN"]
  85. },
  86. {
  87. "id": 8,
  88. "firstName": "Mia",
  89. "lastName": "Iverson",
  90. "email": "mia.iverson@chubb.com",
  91. "phoneNumber": "",
  92. "states": ["CA", "ID", "OR", "WA"]
  93. },
  94. {
  95. "id": 9,
  96. "firstName": "Pat",
  97. "lastName": "Rindels",
  98. "email": "patricia.rindels@chubb.com",
  99. "phoneNumber": "",
  100. "states": ["KY", "OH"]
  101. },
  102. {
  103. "id": 10,
  104. "firstName": "Faye",
  105. "lastName": "Callahan",
  106. "email": "fcallahan@chubb.com",
  107. "phoneNumber": "",
  108. "states": ["IL", "MN"]
  109. },
  110. {
  111. "id": 11,
  112. "firstName": "Brad",
  113. "lastName": "Smith",
  114. "email": "bjsmith@chubb.com",
  115. "phoneNumber": "",
  116. "states": ["IA", "IN", "MO", "MN", "NE", "ND", "SD"]
  117. },
  118. {
  119. "id": 12,
  120. "firstName": "Queenie B",
  121. "lastName": "Gandy",
  122. "email": "qgandy@chubb.com",
  123. "phoneNumber": "",
  124. "states": ["NJ", "NY"]
  125. },
  126. {
  127. "id": 13,
  128. "firstName": "Benjamin D",
  129. "lastName": "Dowd",
  130. "email": "bdowd@chubb.com",
  131. "phoneNumber": "",
  132. "states": ["TX"]
  133. },
  134. {
  135. "id": 14,
  136. "firstName": "Jessica",
  137. "lastName": "Yuspeh",
  138. "email": "jessica.yuspeh@chubb.com",
  139. "phoneNumber": "",
  140. "states": ["DC", "VA"]
  141. },
  142. {
  143. "id": 15,
  144. "firstName": "Dave",
  145. "lastName": "Yeatman",
  146. "email": "",
  147. "phoneNumber": "",
  148. "states": "CAN"
  149. },
  150. {
  151. "id": 16,
  152. "firstName": "Irene T",
  153. "lastName": "Gaughan",
  154. "email": "igaughan@chubb.com",
  155. "phoneNumber": "",
  156. "states": ["NY"]
  157. },
  158. {
  159. "id": 17,
  160. "firstName": "Evelyn",
  161. "lastName": "Rawls",
  162. "email": "evelyn.rawls@chubb.com",
  163. "phoneNumber": "",
  164. "states": ["TX"]
  165. },
  166. ]
  167.  
  168.  
  169.  
  170.  
  171. var newArr = [];
  172.  
  173. for (x = 0; x < contacts.length; x++) {
  174. var current = contactsJSON[x];
  175. current.id = contacts[x];
  176.  
  177. newArr.push(contactsJSON[x]);
  178. }
  179.  
  180. for (x = 0; x < newArr.length; x++) {
  181. var newEl = JSON.stringify(newArr[x]);
  182. console.log(newEl)
  183. }
Add Comment
Please, Sign In to add comment