height: 10vh
is 10% of the veritcal heightheight: 10vw
10% width
= height: 10%
10% of the height of the parentto append something to an array use the push
method: myArray.push(variable)
As a __, I want __, so that____
This section is important as it’s expanding on our understanding of the fundamentals of layout, design and data types.
unordered list
in your HTML document?
- When you want to group a collection of items that do not have a numerical ordering, and their order in the list is meaningless.
bullet style
of unordered list items?
- One can nest bulleted points, or one can use the CSS, specifically the
list-style-type
property.
ordered list
vs an unorder list
in your HTML document?
- Ordered list: when you’ve got a list where the order of the questions matter. Unordered list when it doesn’t matter.
list items
provided by an ordered list
?
- One can also use the CSS property
list-style-type
(e.g.decimal
,lower-alpha
,lower-roman
,upper-roman
). One can use the type attribute (e.g.type="lower-roman"
).
margin
and padding
as characters in a story. What is their role in a story titled: “The Box Model”?
- Margin is the warm embrace around a box, and ensures it doesn’t need to get too close to other. Padding is a supporting character that adds the cushioning within the box. Together, they are going to help the Box take over the world!
box model
.
- Content box: The area where your content is displayed; size it using properties like
inline-size
andblock-size
orwidth
andheight
.- Padding box: The padding sits around the content as white space; size it using
padding
and related properties.- Border box: The border box wraps the content and any padding; size it using
border
and related properties.- Margin box: The margin is the outermost layer, wrapping the content, padding, and border as whitespace between this box and other elements; size it using
margin
and related properties.
data types
can you store inside of an Array
?
- any type of data type can go into an array
people
array a valid JavaScript array? If so, how can I access the values stored? If not, why?
const people = [
['pete', 32, 'librarian', null],
['Smith', 40, 'accountant', 'fishing:hiking:rock_climbing'],
['bill', null, 'artist', null]];
- Yes, this is a valid array. It’s an array of array’s in fact.
- You’d have to first access which array (0, 1, or 2), and then the element within that array. e.g.
people[2][2]
isartist
.
x += 1
(increments x by 1)x -= 1
(decrements x by 1)x *= 2
(multiplies x by 2)x /= 2
(divides x by 2)x %= 3
(x becomes the remainder of prev value of x/3)
expression
and explain what the result would be and why.
```javascript
let a = 10;
let b = ‘dog’;
let c = false;// evaluate this (a + c) + b; ```
10dog
- Check to see if the users cart is empty or not when they click “Checkout”
Loop
is useful in JavaScript.
- Maybe we want to loop until the user enters a valid response.