hasClass(element, className) {
    if (!element) {
      return false;
    }
    // Allow templates to intercept.
    className = ` ${className} `;
    return ((` ${element.className} `).replace(/[\n\t\r]/g, ' ').indexOf(className) > -1);
  }
Determines if an element has a class.

Taken from jQuery https://j11y.io/jquery/#v=1.5.0&fn=jQuery.fn.hasClass
@param {HTMLElement} element - The element to check for the class.
@param {string} className - The class to check for.
@returns {boolean} - TRUE if the element has the class, FALSE otherwise.