Check out example codes for "defer script html". It will help you in understanding the concepts better.
Code Example 1
<!--
The defer attribute specifies that the script
is executed when the page has finished parsing.
Note: This only works for external scripts.
-->
<html>
<head>
<script defer type="text/javascript" src="/path/to/script.js"></script>
...
Code Example 2
<script src="demo_defer.js" defer></script>
Learn ReactJs, React Native from akashmittal.com