/**
 * Extract the government officials from the civic API response.
 */
function extractOfficials(civicObj) {
  let officials = new Object();
  let levels = ["administrativeArea1", "administrativeArea2", "country", "international", "locality", "regional", "special", "subLocality1", "subLocality2"];
  levels.forEach((level) => {
    officials[level] = new Array();
  });
  civicObj.offices.forEach((officeObj) => {
    let level = officeObj.levels[0];
    officeObj.officialIndices.forEach((officialIndex) => {
      let official = civicObj.officials[officialIndex];
      official.title = officeObj.name;
      officials[level].push(official);
    });
  });
  return officials;
}

@@ -138,18 +138,20 @@
 ct();%0A  
-le
+cons
 t levels
@@ -416,18 +416,20 @@
 %3E %7B%0A    
-le
+cons
 t level 
@@ -451,16 +451,133 @@
 els%5B0%5D;%0A
+    // Loop through the officials Indices that work at the current office, and add them to their coresponding level.%0A
     offi

Update civic.js