Check out example codes for "<script> var x = 4; var y = 5; var z = x + y; z = x*y; document.getElementById('demo').innerHtml= z; system.print(z); </script>". It will help you in understanding the concepts better.

Code Example 1

<button tyoe="button" onclick="documnt.getElemnetById('demo').innerHtml=Date()">
Click Me To Display Th Date And Times!
</button>

Learn ReactJs, React Native from akashmittal.com