js/app.js
/* This function creates the last row of the table.
----------------------------------------------------------------------------------------------------*/
This function creates the last row of the table.
This function creates the last row of the table .
function tableFooter() {
  var trEl = document.createElement('tr');
  var thEl = document.createElement('th');
  thEl.textContent = 'Totals For All Locations';
  var trEl = document.createElement('tr');
  trEl.setAttribute('id', 'footer');
  trEl.appendChild(thEl);
  var allTotaled = 0;
  for (var i = 0; i < hours.length; i++) {
    var hourlyTotal = 0;
    for (var j = 0; j < shopList.length; j++) {
      hourlyTotal += shopList[j].cookiesPerCustomerTotal[i];
    }
    allTotaled += hourlyTotal;
    thEl = document.createElement('th');
    thEl.textContent = hourlyTotal;
    trEl.appendChild(thEl);
  }
  thEl = document.createElement('th');
  thEl.textContent = allTotaled;
  trEl.appendChild(thEl);
  cookieStands.appendChild(trEl);
}
function tableFooter ( ) { var trEl = document . createElement ( 'tr' ) ; var thEl = document . createElement ( 'th' ) ; thEl . textContent = 'Totals For All Locations' ; var trEl = document . createElement ( 'tr' ) ; trEl . setAttribute ( 'id' , 'footer' ) ; trEl . appendChild ( thEl ) ; var allTotaled = 0 ; for ( var i = 0 ; i < hours . length ; i ++ ) { var hourlyTotal = 0 ; for ( var j = 0 ; j < shopList . length ; j ++ ) { hourlyTotal += shopList [ j ] . cookiesPerCustomerTotal [ i ] ; } allTotaled += hourlyTotal ; thEl = document . createElement ( 'th' ) ; thEl . textContent = hourlyTotal ; trEl . appendChild ( thEl ) ; } thEl = document . createElement ( 'th' ) ; thEl . textContent = allTotaled ; trEl . appendChild ( thEl ) ; cookieStands . appendChild ( trEl ) ; }
This function creates the last row of the table.
This function creates the last row of the table .
// eslint-disable-next-line no-redeclare
 /* This will set the value for allTotaled to 0.
----------------------------------------------------------------------------------------------------*/ /* This makes the total of each hour show up on the table.
  ----------------------------------------------------------------------------------------------------*/ /* This makes the total of all totals show up on the table.
  ----------------------------------------------------------------------------------------------------*/