JSFiddle - React, Tailwind, and code Playground

by Eugen Sunic

JavaScript

function binarySearch(arr, x, start, end) {
  if (start > end) {
    return;
  }

  let i = Math.floor((start + end) / 2);

  if (arr[i] === item) {
    return true;
  }

  if (x < arr[i]) {
    binarySearch(arr, item, start, mid - 1)

  }

  if (x > arr[i]) {
    binarySearch(arr, item, mid + 1, end)

  }


}


function deleteIndexHrCoverModal() {
  document.body.style = ''
  const fcAbRoot = document.getElementsByClassName('fc-ab-root')
  const dialogContainer = document.getElementsByClassName('fc-dialog-container')
  const dialogOverlay = document.getElementsByClassName('fc-dialog-overlay')
  const nodesToDelete = [...dialogContainer, ...dialogOverlay, ...fcAbRoot];
  if (!!nodesToDelete.length) {
    Array.from(nodesToDelete).forEach(x => x.parentNode.removeChild(x))

  }
}