reading-notes

Class 03 Reading Assignment

Learn HTML

  1. When should you use an unordered list in your HTML document? When the order is irrelevant.

  2. How do you change the bullet style of unordered list items? Use the CSS list-style-type property, because the attributes have been deprecated.

  3. When should you use an ordered list vs. an unordered list in your HTML document? Use an ordered list when the order matters, and list those items with a preceding marker, such as a number or letter. Use an ordered list when the order does not matter.

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

    ## Learn CSS 1. Describe the CSS properties of margin and padding as characters in a story. What is their role in a story titled: "The Box Model"? Padding is a big softie. Padding likes to hug content. But not nearly as much as margin likes to hug. Margin will hug literally everything. Margin fuckin' loves hugs. 2. List and describe the four parts of an HTML elements box as referred to by the box model: 1. Content Box - the area where content is displayed 2. Padding Box - padding sits around the content as white space 3. Border Box - wraps the content and any padding 4. Margin Box - outermost layer, wraps the content, padding, and border as white space between this box and other elements ## Learn JS 1. What data types can you store inside of an array? the primitives - boolean, number, string, null, undefined 2. Is the people array a valid JavaScript array? If so, how can I access the values stored? If not, why? Yes, it is a single object that contains multiple values stored in a list. You can use indexOf() to access material with the arrays. 3. List five shorthand operators for assignment in JavaScript and describe what they do: 1. Addition (+) : x += f() which equates to x = x+f() 2. Subtraction (-) : x-+f() which equates to x = x-f() 3. Multiplication (*) : x *= f() which equates to x = x * f() 4. Division (/) : x /= f() which equates to x = x / f() 5. Assignment (=) : x = f() which equates to x = f() 4. Read the code below and evaluate the last expression and explain what the result whould be and why: let a = 10; let b = 'dog'; let c = false; // evaluate this (a+c)+b; (a+c) + b = '10dog' the number 10 is being added to a string ('dog') which concatanates them into a string together. With c being false, it would'nt add anything to the expression. 5. Describe a real world example of when a conditional statement should be used in a JavaScript program: In a video game, when the player's number of lives is 0, then it's game over. 6. Give an example of when a loop is useful in JavaScript: Loops are useful for rapidly completing repetitive tasks. You can use a loop for calculating squares of numbers. ### Things I Want to Know More About CSS. It seems so simple but yet, it is a real pain in my ass.