Getting Started with JavaScript II
Sufyan bin Uzayr · 2023
The async function aids in the asynchronous execution of promise-based code through the event-loop. To wait for the promise, use the await function within the asynchronous function. Asynchronous code enables the program to be run instantly, but synchronous code prevents continued execution of remaining code until the current one is completed. In current browsers, the script is often bigger than the HTML file, resulting in a greater download size and a longer processing time. This increases the page’s load time and limits the user’s ability to browse the website. The inner HTML property is used to write dynamic html on an HTML document. It is typically used in web sites to produce dynamic html, such as registration forms, comment forms, and links. Fetch is a contemporary and streamlined native JavaScript API for making HTTP requests. It includes promise functionality and improves on the verbose syntax of the previously described XML Http Request.