Everything Else Flashcards

1
Q

Can you set border on an inline element?

A

Yes

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

Can you set margin on a block element?

A

Yes

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

Can you set margin on inline elements?

A

Only on the left and right

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

Can you set padding on a block element?

A

Yes

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

Can you set padding on an inline element?

A

Yes

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

How do you center a block-level element?

A

Set an explicit width like width: 500px; and margin: 0 auto; on the element.

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

How do you center inline content inside of an element?

A

Set text-align: center; on the container

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

How do you create a new DOM element of the div type?

A

document.createElement(‘div’);

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

Is this an absolute or relative path: /User/ericlewis/Desktop

A

absolute

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

Is this an absolute or relative path: unit01/hw

A

relative

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

Is this an anonymous or named function?const x = function() {};

A

An anonymous function

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

Provided a DOM elementconst image = document.querySelector(‘img’);how would you get the source of the image?

A

image.getAttribute(‘src’);

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

Provided a DOM elementconst p = document.querySelector(‘.some-paragraph’);how would you change the paragraph content to the string “hello”?

A

p.innerHTML = ‘hello’;

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

Provided the codeconst alertHi = function(evt) { alert(‘hi’) };const button = document.querySelector(‘button’);how would you invoke alertHi whenever the button is clicked?

A

button.addEventListener(‘click’, alertHi);

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

Provided two DOM elementsconst div = document.createElement(‘div’);const paragraph = document.createElement(‘p’);how would you put the paragraph inside the div?

A

div.appendChild(paragraph);

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

The CSS property for setting the font color

A

color

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

What are the layers of the box model?

A

Content, padding, border, and margin

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

What color is rgba(0, 0, 255, 1); ?

A

blue

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

What command makes a folder into a git repository?

A

git init

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

What command will copy the file script.js into the javascript/ directory?

A

cp script.js javascript/

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

What command will create a new directory named css/?

A

mkdir css

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

What CSS property defines the spacing between flex items?

A

justify-content

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

What CSS rule do you apply to an element to make it a flex container?

A

display: flex;

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

What do the first two numbers in a hex code represent?

A

The red value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What do we call it when we access a property on an object like this:person.name
dot notation
26
What do we call it when we access a property on an object like this:person['name']
Bracket notation
27
What do we call these: []
brackets
28
What do we call these: { }
curly braces
29
What do you call x and y here?someFunction(x, y);
Function arguments
30
What does Math.ceil() do?
Rounds a number up to the next integer
31
What does Math.random() return?
A random decimal number between 0 and 1
32
What does pwd do?
Prints the current directory
33
What does the command do? cd ../../..
change three directories up
34
What does the document.querySelector function return?
An HTMLElement
35
What does this command do: mv a.jpg b.jpg Pictures/
Move two images into the Pictures folder
36
What does this command do?git add script.js
Add changes in script.js to the staging area
37
What does this command do?git push origin master
Push all commits from the local repository's master branch to the remote origin's master branch
38
What DOM event fires when a user presses a key on their keyboard?
keydown
39
What DOM event fires when the user scrolls down the page?
scroll
40
What is master in this command?git push origin master
A branch
41
What is origin here?git push origin master
A remote repository
42
What is output with this code?const x = 3;const y = x \> 2 ? 10 : 1;console.log(y);
10
43
What is the default value of flex-wrap?
no-wrap
44
What is the generic block element that has no semantic meaning?
div
45
What is the generic inline element that has no semantic meaning?
span
46
What is the hex color for black?
#000000
47
What is the hex color for white?
#ffffff
48
What rule would you set on a flex container to make the flex items wrap onto multiple rows?
flex-wrap: wrap;
49
What screen will this media query affect?@media screen (min-width: 450px) and (max-width: 768px) {}
Screens with a width between 450 and 768 pixels
50
What screens will this media query affect?@media screen and (min-width: 300px) {}
Screens wider than 299 pixels
51
What type of data does document.querySelectorAll() return?
A NodeList containing HTML elements
52
What value does this code evaluate to?'hi there'.length
8
53
What value does this code evaluate to?['abba', 'boy', 'beach'].map(function(word) { return word.length });
[4, 3, 5]
54
What value does this code evaluate to?Math.floor( 3.493 ) + 1;
4
55
What value does this code evaluate to?parseInt('123abc');
123
56
What value represents emptiness in JavaScript?
null
57
What's command will remove a directory called "images/"?
rm -r images
58
When does "i \< 10" evaluate in the code below?for ( let i = 0; i \< 10; i++ ) { console.log(i);}
Before each iteration of the for loop body
59
When does "i++" evaluate in the code below?for ( let i = 0; i \< 10; i++ ) { console.log(i);}
After each iteration of the for loop body
60
When does "let i = 0" evaluate in the code below?for ( let i = 0; i \< 10; i++ ) { console.log(i);}
One time, at the beginning of the for loop
61
When value does this code evaluate to?['abba', 'boy', 'beach'].filter(function(word) { return word.length \> 3 });
['abba', 'beach']
62
Will this code produce an error?const x = 3;x = 4;
Yes. A variable declared with a const cannot be reassigned