While the browser builds the DOM it checks for the correctness of the code.
While executing Javascript the DOM is used to examine the page, change it and recieve events from it
Javascript can accomplish most things a regular programming language can with some exceptions.
Unlike C++ in Javascript you do not have to declare the type of a variable however they similar follow the syntax of ending statements in semicolons.
Declare variables as var x; additionally Javascript is case sensetive meaning var X; and var x; are different variables
In Javascript the for() and while() loops have similar syntax to C++, both enclosing the conditional in () and in the case for if statements it begins with initializing the counter, then the conditional test and finally the update to the counter.
We can directly run Javascript code by linking a seperate file with the code using src of the <script>
tag.
.getElementById() returns the element that corresponds with the id given. We can then manipulate that element by accessing their attributes, for example we can access a element's .innerhtml()
To run code after a page loads (the DOM fully loads) we can use windows.onload = myfunction() (or we can put the code at the end of the webpage)
To create a array we use new Array() or simply group what you want with [] and a comma to seperate each item