Sprint 3 Technical Blog

3, May 2019

Contents

What is the DOM?

It’s shorthand for Document Object model.


What is it?

It’s like an object encapsulating all the elements of what makes a webpage together. The url, html elements and scripts.

It is a two way street where information can be relayed to you and can be changed and edited.


How does it relate to HTML and CSS as well as Javascript?

HTML

It relates to HTML due to the fact that html is a Node within the DOM. HTML also contains nodes called elements which will determine the structure of the page.

CSS

It relates to CSS because CSS helps with the DOM but also the DOM can relay information to CSS to make changes to position of text, sizes of elements and media queries.

Javascript

You can use Javascript to manipulate almost every aspect of the DOM. You can place scripts into the DOM and then change HTML and CSS dynamically to make one page websites, animations, interactive UI and many more!

What if HTML and CSS were real life objects?

HTML a flower pot where you can add flowers inside. The flowers inside can be taken out and put in or changed.

That where CSS comes in and CSS is like a garden tools that a gardener, the web designer, can use to make the flowers look good. Even change the look of the flower pot as well or even hide the whole flower pot.

What is Control Flow?

Control flow is the control of the order of execution of statments within a function or a program.

Control flow and loops can be describe as a process like ordering food at a restaurant.

orderFood Diagram

What are functions and why are they useful?

Functions are objects that can contain statements and values that execute a task.

You can call these functions in different orders or all at once to carry out a common goal.

What are the differences between arrays and objects?

Arrays are similar to lists you can access them my having and index from 0 till N which is the number of items in the array. You can loop through an array. For eg.

listyMcListyFace[0]

However objects can have data accessed my just using the names of the data you want. You cannot Loop through an object value. For eg.

             objectMcObjectFace(thing){
                this.thing
            }
            
            objectMcObjectFace.thing