An introduction to JavaScript
In this section, we will briefly introduce some basic JavaScript concepts. This includes data structures such as variables, constants, arrays, and objects and callables such as functions, classes, and methods. Different operators will be covered as we introduce them.
This will give us the requisite knowledge to begin a brief overview of the React framework.
Loading JavaScript
JavaScript can either be inline in an HTML page or included in a separate JavaScript file. Both methods use the <script>
tag. With inline JavaScript, the JavaScript code is written directly inside the <script>
tags in an HTML file; for example, like this:
<script> // comments in JavaScript can start with // /* Block comments are also supported. This comment is multiple lines and doesn't end until we use a star then slash:/ let...