An analogy for HTML and CSS would be to think of them as a house. HTML would be the rooms of the house, the walls, the doors, the windows etc. CSS would the decorations, or the style; colour of paint on the wall, the type of flooring, the curtains, the pictures on the wall etc.
Control flow is about using conditional statements to perform different actions based on different conditions. Conditional statements are ‘if’ ‘else’ ‘else if’ and ‘switch’. An example can be shown using typical greetings: if the time is earlier than 10am, I will say “good morning. If the time is not earlier than 10am, but earlier than 6pm, I will say “good day”, otherwise I will say “good evening”.
Loops continue to execute a set of code of over and over or until a certain condition is met. They are good if you want to run the same code over and over, each time with a different value. There are ‘for’ ‘while’ and ‘do…while’ loops. An example is while children are from age 5 - 18, they continue to go to school. When they are 18, they stop.
If we go back to the the house analogy. The DOM (Document Object Model), would be the structure or blue-print on the house. It can be thought of as a tree-like structure. You can use the web developer tools in Chrome to see the branching by clicking on the triangles.
Objects are useful for storing data in a structured way, like information for an album. Objects contain properties (format, release date) and the values of those properties, and are written as name:value pairs. You can access object properties by using objectName.propertyName or objectName[“propertyName”]. E.g. album.format or album[“format”].
A function is a block of code designed to perform a particular task and is useful because it can be used many times with different arguments to produce different results.