function ifElement (query, func, extraFunc) {
  ensureDomLoaded(() => {
    let e = document.querySelector(query)
    if (e) {
      func(e)
    } else if (extraFunc) {
      extraFunc()
    }
  })
}
Will check if an element exists on the page and then call a function by calling ensureDomLoaded. If the element doesn't exist, the function will check if another function is passed and call it if it is. This is used to prevent the script from running if the element doesn't exist. Generally, you will not need to add a second function, but it can be useful at times.
@param {string} e - The element to check.
@param {function} f - The function to call.
@param {function} [f2] - The function to call if the element doesn't exist.