# LEARNING JAVASCRIPT; FROM VARIABLES TO THE DOM
INTRODUCTION
As a beginner developer the first ever programming language you get to learn is Javascript; you may be wondering why and what about HTML and CSS, well HTML is basically just structural rendition or representation of a webpage and the CSS (cascading style sheet) is just the styling that is applied to the webpage to make it more presentable or colourful. Think of HTML as a fence that is built and bare and the CSS as paint that is applied to the fence to make it more beautiful. These languages do not possess any form logic and that is the difference between them and JavaScript, JavaScript is able to perform logical operations or actions or handle or posses logic and that is why it is refered to as the first programing language any developer learns.
BEGINNING JAVASCRIPT
There are common tracks or points where every developer gets to begin and treat in JavaScript and will will discuss a few of them.
VARIABLES
Simply put a variable is a container that holds a value or stores a value. JavaScript uses these variables to store these values or data for later usage when it is called upon. You declare a varibale using the keyword `var, const or let`, example; `var = "value";` or `const = "value"` or `let = "value"`. Say you have a name and your name is Peter, anytime someone wants to address you they will always refer to you as Peter and JavaScript acts the same way but to do this it is going to store Peter in a variable e.g, "name" so that anytime the variable is called, it knows that value is Peter and anytime peter is called it knows that you are refering to name.
OBJECTS AND OBJECT METHODS
OBJECTS
These are standalone varaibles that are assigned to a single varible and the varibales that are within this single varibale are now addressed as properties. Objects in JavaScript are indentified using curly braces or curly brackets `{}`.
Object;
```
let orc = {
height: 55,
color: "green",
weight: 185
}
```
Note that the properties of an object are always separated by a comma.
OBJECT METHODS
These are methods used to manipulate our objects and get them to react or respond in the different ways we want.
ARRAYS AND ARRAY METHODS
ARRAY
Arrays can simply be seen as objects but not normal objects. A normal object has the name-value pair while arrays posses the index-value pair or index-element pair. The contents of an array are called elements and are also seprated by comma and array can hold multiple data types.
ARRAY METHODS
Just like object methods, these are used to manipulate arrays e.g `slice, splice, push, find, shift, unshift, pop`etc.
OPERATORS
Operators in Javascript can be basically divided into Assignment and Arithmetic operators. These operators are used to manipulate your various data types in JavaScript examples of these operators are
```
= which is an assigment operator
+, -, *, / which are arithmetic operators.
```
THE DOM AND DOM METHODS
THE DOM
Since HTML is a markup language, JavaScript does not interact with our webpage directly and in order for JavaScript to be able to access our webpage which is a HTML document, it uses medium and this medium is called the Document Object Model (DOM). This is a total model of our webpage from top to bottom which the Javascript can use to manipulate our webpage, the DOM uses the Parent-Child relationship to achieve this.
DOM METHODS
These are methods used to traverse and manipulate the DOM. example the create element method `Create Element Method: A method used to create new elements
document.createElement("div")`
Note: there are several DOM methods out there and not just ths one.
CONCLUSION
JavaScript as a langauge is broad but can be understood, following a well tailored learning path. There are many other topics that I did not mention in this article and you should not be surprised if you come across them, but the ones mentioned in this article are unavoidable. The best part about learning JavaScript is the learning process and seeing how everything works using JavaScript. Keep Building!.