HTML, CSS & JavaScript basics
13 February, 2020
An analogy to describe the differences between HTML and CSS
The structure of a website is just like any living beings! It has a skeletal structure, flesh and a central nervous system, a.k.a. the brain.
Skeletal structure allows us to differentiate between different animals, say a dog from a cat. It is the fundamental characteristic that allows us to classify different species. Makeup language is the basic foundation that make up a website, while HTML is the main markup language used to build a website, do keep in mind that it is not the only markup language in existence.
Flesh is just like CSS; it beautifies the basic skeletal structure and brings it to life. CSS gives additional characteristics to a website, it has control over the entire design of a website from color scheme to font style to item placements, etc…
Lastly the brain connects both skeletal structure and flesh together to form cute furballs that we know and love.
Explain control flow and loops using an example process from everyday life, for example 'waking up' or 'brushing your teeth'. (But not those ones).


Describe what the DOM is and an example of how you might interact with it.
DOM stands for Document Object Model, it is a cross-platform standard for representing and interacting with objects in HTML, XHTML and XML documents.
Although JavaScript is one of the most popular languages for manipulating DOM, DOM implementation can be built for any language.
An example of JavaScript interacting with DOM is using getElementsByClassName()
method. Thiw will return all objects with the same class identifier within a document, in this case, the title of the document

Explain the difference between accessing data from arrays and objects.
An array is a variable that stores a collection of items. It creates an ordered collections where items can be accessed by their numerical position in the list.
An object is a variable that stores a collection of key-value pairs. The value of an object can be accessed by the key that's paired with the value.
Explain what functions are and why they are useful.
A function is a piece of code that performs a specific task.
It is useful because you can combine multiple functions to perform complex tasks, or use control flow statements to perform repetitive tasks.