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
Q

What do we call it when we access a property on an object like this:person.name

A

dot notation

26
Q

What do we call it when we access a property on an object like this:person[‘name’]

A

Bracket notation

27
Q

What do we call these: []

A

brackets

28
Q

What do we call these: { }

A

curly braces

29
Q

What do you call x and y here?someFunction(x, y);

A

Function arguments

30
Q

What does Math.ceil() do?

A

Rounds a number up to the next integer

31
Q

What does Math.random() return?

A

A random decimal number between 0 and 1

32
Q

What does pwd do?

A

Prints the current directory

33
Q

What does the command do? cd ../../..

A

change three directories up

34
Q

What does the document.querySelector function return?

A

An HTMLElement

35
Q

What does this command do: mv a.jpg b.jpg Pictures/

A

Move two images into the Pictures folder

36
Q

What does this command do?git add script.js

A

Add changes in script.js to the staging area

37
Q

What does this command do?git push origin master

A

Push all commits from the local repository’s master branch to the remote origin’s master branch

38
Q

What DOM event fires when a user presses a key on their keyboard?

A

keydown

39
Q

What DOM event fires when the user scrolls down the page?

A

scroll

40
Q

What is master in this command?git push origin master

A

A branch

41
Q

What is origin here?git push origin master

A

A remote repository

42
Q

What is output with this code?const x = 3;const y = x > 2 ? 10 : 1;console.log(y);

A

10

43
Q

What is the default value of flex-wrap?

A

no-wrap

44
Q

What is the generic block element that has no semantic meaning?

A

div

45
Q

What is the generic inline element that has no semantic meaning?

A

span

46
Q

What is the hex color for black?

A

000000

47
Q

What is the hex color for white?

A

ffffff

48
Q

What rule would you set on a flex container to make the flex items wrap onto multiple rows?

A

flex-wrap: wrap;

49
Q

What screen will this media query affect?@media screen (min-width: 450px) and (max-width: 768px) {}

A

Screens with a width between 450 and 768 pixels

50
Q

What screens will this media query affect?@media screen and (min-width: 300px) {}

A

Screens wider than 299 pixels

51
Q

What type of data does document.querySelectorAll() return?

A

A NodeList containing HTML elements

52
Q

What value does this code evaluate to?’hi there’.length

A

8

53
Q

What value does this code evaluate to?[‘abba’, ‘boy’, ‘beach’].map(function(word) { return word.length });

A

[4, 3, 5]

54
Q

What value does this code evaluate to?Math.floor( 3.493 ) + 1;

A

4

55
Q

What value does this code evaluate to?parseInt(‘123abc’);

A

123

56
Q

What value represents emptiness in JavaScript?

A

null

57
Q

What’s command will remove a directory called “images/”?

A

rm -r images

58
Q

When does “i < 10” evaluate in the code below?for ( let i = 0; i < 10; i++ ) { console.log(i);}

A

Before each iteration of the for loop body

59
Q

When does “i++” evaluate in the code below?for ( let i = 0; i < 10; i++ ) { console.log(i);}

A

After each iteration of the for loop body

60
Q

When does “let i = 0” evaluate in the code below?for ( let i = 0; i < 10; i++ ) { console.log(i);}

A

One time, at the beginning of the for loop

61
Q

When value does this code evaluate to?[‘abba’, ‘boy’, ‘beach’].filter(function(word) { return word.length > 3 });

A

[‘abba’, ‘beach’]

62
Q

Will this code produce an error?const x = 3;x = 4;

A

Yes. A variable declared with a const cannot be reassigned