String
vs a Number
in JavaScript?Variable
and why are they important in JavaScript?<link>
elements that reference external CSS sytlesheets and <script>
elements referencing external JavaScript scripts<link>
and <script>
elements<link>
elements<script>
elementsTools
» Usage Rights
and select Creative Commons licenses
<script>
element
<script src="scripts/main.js"></script>
let
Variable | Explanation | Example |
---|---|---|
String | Text. Signified by '' |
let myVar = `Bob`; |
Number | Number. | let myVar = 10; |
Boolean | True/False. Used with keywords true & false |
let myVar = true; |
Array | Multiple values stored in a single reference. Signified by [] |
let myVar = ['Bob','Steve','John']; Refer to each member of the array like this: myVar[0], myVar[1], etc. |
Object | Everything in JS is an object. | `let myVar = document.querySelector(‘h1’); |