how async code works in javascript code example
Example 1: script async syntax
<script src="demo_async.js" async></script>
Example 2: async await javascript
myFunction().then(
function(value) { /* code if successful */ },
function(error) { /* code if some error */ }
);