function formatFavoriteTimeZones() {
  let timeZoneTable =
    "<tr><th>Country Code</th><th>Country Name</th><th>Zone Name</th><th>Time</th><th>Date</th><th>Add</th></tr>";
  if (favoriteTimeZonesToRender.length > 0) {
    favoriteTimeZonesToRender.forEach(function (timeZone, index) {
      const row = `<tr><td>${timeZone.countryCode}</td><td>${
        timeZone.countryName
      }</td><td>${timeZone.zoneName}</td><td>${timeZone.zoneTimeDate.format(
        "HH:mm:ss"
      )}</td><td>${timeZone.zoneTimeDate.format(
        "DD-MM-YYYY"
      )}</td><td>  <button id="${
        "Remove_" + String(index)
      }">Remove</button></td></tr>`;
      timeZoneTable = timeZoneTable + row;
    });
  }
  document.getElementById("favoriteTimeZonesTable").innerHTML = timeZoneTable;
}
//this renders the time zones in favoriteTimeZonesToRender
this renders the time zones in favoriteTimeZonesToRender
this renders the time zones in favoriteTimeZonesToRender
function formatFavoriteTimeZones() {
  let timeZoneTable =
    "<tr><th>Country Code</th><th>Country Name</th><th>Zone Name</th><th>Time</th><th>Date</th><th>Add</th></tr>";
  if (favoriteTimeZonesToRender.length > 0) {
    favoriteTimeZonesToRender.forEach(function (timeZone, index) {
      const row = `<tr><td>${timeZone.countryCode}</td><td>${
        timeZone.countryName
      }</td><td>${timeZone.zoneName}</td><td>${timeZone.zoneTimeDate.format(
        "HH:mm:ss"
      )}</td><td>${timeZone.zoneTimeDate.format(
        "DD-MM-YYYY"
      )}</td><td>  <button id="${
        "Remove_" + String(index)
      }">Remove</button></td></tr>`;
      timeZoneTable = timeZoneTable + row;
    });
  }
  document.getElementById("favoriteTimeZonesTable").innerHTML = timeZoneTable;
}
function formatFavoriteTimeZones ( ) { let timeZoneTable = "<tr><th>Country Code</th><th>Country Name</th><th>Zone Name</th><th>Time</th><th>Date</th><th>Add</th></tr>" ; if ( favoriteTimeZonesToRender . length > 0 ) { favoriteTimeZonesToRender . forEach ( function ( timeZone , index ) { const row = ` ${ timeZone . countryCode } ${ timeZone . countryName } ${ timeZone . zoneName } ${ timeZone . zoneTimeDate . format ( "HH:mm:ss" ) } ${ timeZone . zoneTimeDate . format ( "DD-MM-YYYY" ) } ${ "Remove_" + String ( index ) } ` ; timeZoneTable = timeZoneTable + row ; } ) ; } document . getElementById ( "favoriteTimeZonesTable" ) . innerHTML = timeZoneTable ; }
this renders the time zones in favoriteTimeZonesToRender
this renders the time zones in favoriteTimeZonesToRender