How do I show Modal onPage load?

This question was asked by one of our community members on Discord:

How can I show the modal on page load?

To show Modal onPageLoad we can write a JSObject and call the showModal(<ModalName>) function and toggle the run onPageLoad option under the settings tab.

{
 myFun1: () => {
    showModal('Modal1');
}