Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var contacts = [
- "8e010f59181f4a588fc4383c61a53a30",
- "3a57f0bcdb644615a922059689350da9",
- "f2fc2ec188cf40d481961abeb0817233",
- "6357e76c199c43e396b9edb1be41781e",
- "4a41a34a9124432aae1f64b4aa2a73c8",
- "4bc07194ccc24391946cd67ac4d23f05",
- "c36c169d5b85464ab0060edda1a67a90",
- "480b195e976e4b57ab0cf4bd1a79eb4f",
- "85e6aa639c6441dcb2ba5503cad106d2",
- "8de7e148a8b24b12bab1532a3e523b94",
- "bb291d8588824a468b0e4d83d8062000",
- "e9221bb8de8e43cbb1efb2fbd2112ab5",
- "f408b2b8c9bc4a84a6beff7df301040e",
- "a464edcb412243aebbf7591ab32c9100",
- "199acdb86d474b72b81927f35b2c8dc8",
- "f9ab3d6b248c4aa48998a1c5e0390285",
- "08b7168546f64668a02f1b12c9a47aff"
- ]
- var contactsJSON = [
- {
- "id": 0,
- "firstName": "Suzy",
- "lastName": "Hollifield",
- "email": "suzy.hollifield@chubb.com",
- "phoneNumber": "",
- "states": ["AL", "GA", "LA"]
- },
- {
- "id": 1,
- "firstName": "Matt",
- "lastName": "Brodsky",
- "email": "matthew.brodsky@chubb.com",
- "phoneNumber": "",
- "states": ["AL", "CO", "HI", "OK", "UT", "WY"]
- },
- {
- "id": 2,
- "firstName": "Connie",
- "lastName": "Taylor",
- "email": "connie.taylor@chubb.com",
- "phoneNumber": "",
- "states": ["AZ", "CA", "NM", "NV"]
- },
- {
- "id": 3,
- "firstName": "Jim",
- "lastName": "Hennessy",
- "email": "james.hennessy@chubb.com",
- "phoneNumber": "",
- "states": ["AR", "IL", "KS", "MI", "MS", "MO", "WI"]
- },
- {
- "id": 4,
- "firstName": "Josh",
- "lastName": "Gibbons",
- "email": "joshua.gibbons@chubb.com",
- "phoneNumber": "",
- "states": ["CT", "MA", "NH", "RI", "VT"]
- },
- {
- "id": 5,
- "firstName": "Jeffrey",
- "lastName": "Dietrich",
- "email": "jdietrich@chubb.com",
- "phoneNumber": "",
- "states": ["DE", "MD", "DC"]
- },
- {
- "id": 6,
- "firstName": "Nicole",
- "lastName": "Troxell",
- "email": "ytroxell@chubb.com",
- "phoneNumber": "",
- "states": ["Florida"]
- },
- {
- "id": 7,
- "firstName": "Ryan",
- "lastName": "Vette",
- "email": "ryan.vette@chubb.com",
- "phoneNumber": "",
- "states": ["GA", "NC", "TN"]
- },
- {
- "id": 8,
- "firstName": "Mia",
- "lastName": "Iverson",
- "email": "mia.iverson@chubb.com",
- "phoneNumber": "",
- "states": ["CA", "ID", "OR", "WA"]
- },
- {
- "id": 9,
- "firstName": "Pat",
- "lastName": "Rindels",
- "email": "patricia.rindels@chubb.com",
- "phoneNumber": "",
- "states": ["KY", "OH"]
- },
- {
- "id": 10,
- "firstName": "Faye",
- "lastName": "Callahan",
- "email": "fcallahan@chubb.com",
- "phoneNumber": "",
- "states": ["IL", "MN"]
- },
- {
- "id": 11,
- "firstName": "Brad",
- "lastName": "Smith",
- "email": "bjsmith@chubb.com",
- "phoneNumber": "",
- "states": ["IA", "IN", "MO", "MN", "NE", "ND", "SD"]
- },
- {
- "id": 12,
- "firstName": "Queenie B",
- "lastName": "Gandy",
- "email": "qgandy@chubb.com",
- "phoneNumber": "",
- "states": ["NJ", "NY"]
- },
- {
- "id": 13,
- "firstName": "Benjamin D",
- "lastName": "Dowd",
- "email": "bdowd@chubb.com",
- "phoneNumber": "",
- "states": ["TX"]
- },
- {
- "id": 14,
- "firstName": "Jessica",
- "lastName": "Yuspeh",
- "email": "jessica.yuspeh@chubb.com",
- "phoneNumber": "",
- "states": ["DC", "VA"]
- },
- {
- "id": 15,
- "firstName": "Dave",
- "lastName": "Yeatman",
- "email": "",
- "phoneNumber": "",
- "states": "CAN"
- },
- {
- "id": 16,
- "firstName": "Irene T",
- "lastName": "Gaughan",
- "email": "igaughan@chubb.com",
- "phoneNumber": "",
- "states": ["NY"]
- },
- {
- "id": 17,
- "firstName": "Evelyn",
- "lastName": "Rawls",
- "email": "evelyn.rawls@chubb.com",
- "phoneNumber": "",
- "states": ["TX"]
- },
- ]
- var newArr = [];
- for (x = 0; x < contacts.length; x++) {
- var current = contactsJSON[x];
- current.id = contacts[x];
- newArr.push(contactsJSON[x]);
- }
- for (x = 0; x < newArr.length; x++) {
- var newEl = JSON.stringify(newArr[x]);
- console.log(newEl)
- }
Add Comment
Please, Sign In to add comment