JavaScript Async Form Submission: Understanding await and preventDefault
The browser decides whether to submit a form as soon as the synchronous part of your submit handler returns, and the first await ends that part. Call event.preventDefault() before…