Week 1 Flashcards

1
Q

Name two types of units that can be used to adjust font-size in CSS.

A

pixels, px and rem/em, and percentages, % (do not use percentage)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What CSS property controls the font used for the text inside an element?

A

font-family, e.g. body {font-family: sans-serif}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What CSS properties make up the box model?

A

content, padding, margin,border

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which CSS property pushes boxes away from each other?

A

margin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which CSS property add space between a box’s content and its border?

A

padding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the default flex-direction of a flex container?

A

row (horizontally), left to right

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the default flex-wrap of a flex container?

A

nowrap (none)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why do two div elements “vertically stack” on one another by default?

A

they are by default block level, i.e. display: block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the default flex-direction of an element with display: flex?

A

horizontal, left to right

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three primary components of a page layout? (Which helper classes do you need?)

A

row, column, container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the minimum number of columns that you should put in a row?

A

one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of a container?

A

to encase things so you can flexbox?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the default value for the position property of HTML elements?

A

static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does setting position: relative on an element affect document flow?

A

It doesn’t but items inside will move if removed from doc flow?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does setting position: relative on an element affect where it appears on the page?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does setting position: absolute on an element affect where it appears on the page?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you constrain an absolutely positioned element to a containing block?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the four box offset properties?

A

left, right, bottom, top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

how do you overlay items on top of each other?

A

you can adjust ordering using “z-index”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Why do we log things to the console?

A

to make sure your code is working!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a method?

A

A method is a function which is a property of an object. There are two kinds of methods: instance methods which are built-in tasks performed by an object instance, or static methods which are tasks that are called directly on an object constructor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How is a method different from any other function?

A

it is a property of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do you remove the last element from an array?

A

pop() method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How do you round a number down to the nearest integer?

A

Math.floor() method

25
How do you generate a random number?
Math.random() method
26
How do you delete an element from an array?
.splice() method
27
How do you append an element to right end of an array?
.push() method
28
How do you break a string up into an array?
.split() method
29
Do string methods change the original string? How would you check if you weren't sure?
No, strings are immutable. to check, console log it
30
Roughly how many string methods are there according to the MDN Web docs?
around 50
31
Is the return value of a function or method useful in every situation?
no because you might use/do somthing different in the function later
32
Roughly how many array methods are there according to the MDN Web docs?
33
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN !
34
how do u link js file to html?
35
Give 6 examples of comparison operators.
&& || < > etc..
36
What data type do comparison expressions evaluate to?
bulion
37
What is the purpose of an if statement?
conditions
38
Is else required in order to use an if statement?
no
39
Describe the syntax (structure) of an if statement.
if (a < b) {return false}
40
What are the three logical operators?
How do you compare two different expressions in the same condition?
41
What are the three logical operators?
42
How do you compare two different expressions in the same condition?
using "and" or "or"
43
What is the purpose of a loop?
run code repeated times under specific conditions
44
What is the purpose of a condition expression in a loop?
tells how long / many times loop to run for
45
What does "iteration" mean in the context of loops?
number of times loop runs
46
When does the condition expression of a while loop get evaluated?
at beginning of each iteration
47
When does the initialization expression of a for loop get evaluated?
at start of loop
48
When does the condition expression of a for loop get evaluated?
after initialization and after every iteration
49
When does the final expression of a for loop get evaluated?
after the iteration
50
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
the break keyword
51
What does the ++ increment operator do?
increments value by 1
52
How do you iterate through the keys of an object?
"for in" loop
53
how do use find loop debugger?
something like this!: inspector, sources, , main d js, left click, debugger, or enter debugger keyword above console log in code block
54
What are the four components of "the Cascade".
source order, specificity, inheritance, important
55
What does the term "source order" mean with respect to CSS?
the order in which css rules are written in stylesheet and order in which they are prioritized (last being hightest priority)
56
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
using inheritance if it is available. inheritance will apply to other items inside the element.
57
List the three selector types in order of increasing specificity.
element, class, ID
58
Why is using !important considered bad practice?
because it implies one is not following other best practices by organizing code correctly
59
selecotors by priority order
(lowest to hightest) universal selector(*), element, class, id, inline, important