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
Q

How do you generate a random number?

A

Math.random() method

26
Q

How do you delete an element from an array?

A

.splice() method

27
Q

How do you append an element to right end of an array?

A

.push() method

28
Q

How do you break a string up into an array?

A

.split() method

29
Q

Do string methods change the original string? How would you check if you weren’t sure?

A

No, strings are immutable.

to check, console log it

30
Q

Roughly how many string methods are there according to the MDN Web docs?

A

around 50

31
Q

Is the return value of a function or method useful in every situation?

A

no because you might use/do somthing different in the function later

32
Q

Roughly how many array methods are there according to the MDN Web docs?

A
33
Q

What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?

A

MDN !

34
Q

how do u link js file to html?

A

<body>



</body>
35
Q

Give 6 examples of comparison operators.

A

&& || < > etc..

36
Q

What data type do comparison expressions evaluate to?

A

bulion

37
Q

What is the purpose of an if statement?

A

conditions

38
Q

Is else required in order to use an if statement?

A

no

39
Q

Describe the syntax (structure) of an if statement.

A

if (a < b) {return false}

40
Q

What are the three logical operators?

A

How do you compare two different expressions in the same condition?

41
Q

What are the three logical operators?

A
42
Q

How do you compare two different expressions in the same condition?

A

using “and” or “or”

43
Q

What is the purpose of a loop?

A

run code repeated times under specific conditions

44
Q

What is the purpose of a condition expression in a loop?

A

tells how long / many times loop to run for

45
Q

What does “iteration” mean in the context of loops?

A

number of times loop runs

46
Q

When does the condition expression of a while loop get evaluated?

A

at beginning of each iteration

47
Q

When does the initialization expression of a for loop get evaluated?

A

at start of loop

48
Q

When does the condition expression of a for loop get evaluated?

A

after initialization and after every iteration

49
Q

When does the final expression of a for loop get evaluated?

A

after the iteration

50
Q

Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?

A

the break keyword

51
Q

What does the ++ increment operator do?

A

increments value by 1

52
Q

How do you iterate through the keys of an object?

A

“for in” loop

53
Q

how do use find loop debugger?

A

something like this!: inspector, sources, , main d js, left click, debugger, or enter debugger keyword above console log in code block

54
Q

What are the four components of “the Cascade”.

A

source order, specificity, inheritance, important

55
Q

What does the term “source order” mean with respect to CSS?

A

the order in which css rules are written in stylesheet and order in which they are prioritized (last being hightest priority)

56
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

using inheritance if it is available. inheritance will apply to other items inside the element.

57
Q

List the three selector types in order of increasing specificity.

A

element, class, ID

58
Q

Why is using !important considered bad practice?

A

because it implies one is not following other best practices by organizing code correctly

59
Q

selecotors by priority order

A

(lowest to hightest)

universal selector(*),
element,
class,
id,
inline,
important