Check out example codes for "what is the use of script tag in html". It will help you in understanding the concepts better.
Code Example 1
<script>
//Insert JS scripts here
var html
html = "You can use the <script> tag to incorporate JS code into your HTML code"
console.log(html)
</script>
Learn ReactJs, React Native from akashmittal.com