Without further ado, let’s get straight to the point. The operating principle of javascript is summarized as follows:
1. Execute javascript code in the order of html document flow
The browser gradually parses the page structure and information from top to bottom according to the document flow. The javascript code is an embedded script and a component of the html document, so the execution order of the javascript code when loading is also based on the script tag