reading-notes

Class 3 Notes

why this topic matters

Continuing to break down components of html, css, and javascript

When should you use an unordered list in your HTML document?

Whenever you are listing items that are do not require in any sequetial order or order of importance.

How do you change the bullet style of unordered list items?

The bullet style of the list is determined by the CSS.

When should you use an ordered list vs an unorder list in your HTML document?

Unordered lists are meant for items that are grouped together in a meaningless order or sequence. The ordered lists are specifically for items where they need to presented in an order of importance.

Describe two ways you can change the numbers on list items provided by an ordered list?

You can define how you want the list to start within the opening tag by using the start Attribute ex. < OL start=”4” > Or you can start the order in the CSS

Describe the CSS properties of margin and padding as characters in a story. What is their role in a story titled: “The Box Model”?

Lets pretend that the content is a princess in a castle. In this fairytale story the princess is the castle is surrounded by a moat. The land between the castle and the moat is what we call padding. If we are prince charming trying to get it we might consider the very edge of the land (where it meets the moat) the border of the castles land. We can then call the moat and its contents the margin. This is what truly seapates the castle from foreign invaders.

List and describe the four parts of an HTML elements box as referred to by the box model.

What data types can you store inside of an Array?

Any data can be stored in an array. Strings, numbers or even strings and numbers.

Is the people array a valid JavaScript array? If so, how can I access the values stored? If not, why?

Yes console.log(people);

List five shorthand operators for assignment in javascript and describe what they do.

x = f() -Assigns a value to a variable

x += f() -Performs addition by numerical value or concatenation

x -= f() -Performs subtraction by numerical value or concatenation

x *= f() -Performs multiplication of two operands

x /= f() -Performs division of two operands

Read the code below and evaluate the last expression and explain what the result would be and why.

let a = 10; let b = ‘dog’; let c = false;

// evaluate this (a + c) + b;

False because C is false. If any part of the expression is false, it is all false.

Describe a real world example of when a conditional statement should be used in a JavaScript program.

A simple example might be that if you log onto a website during the day, the website may appear bright with light clouds in the background like the sun is out and at night it appears dark with stars in the background like its a window to the outside world.

Give an example of when a Loop is useful in JavaScript.

When you have to do a task over and over again.