JXA JavaScript for automation How to make JXA click something What is the JXA equivalent of

--AppleScript
    tell application ("System Events")
        click at(x,y)
    end tell
Application("System Events")
  .applicationProcesses.whose({frontmost: true}).at(0)
  .click({ at: [x, y] })


click is performed on a UIElement, so we get one, then call click with that.