Code Reading Flashcards

1
Q
Code read this:
var numOfStudents = students.length
A
  • The length property
  • Of the students object
  • Is assigned the variable numOfStudents
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Code read this:

var student = {
   firstName: 'Luke',
   lastName: 'Skywalker',
   age: 25
};
A
  • Object literal being assigned the variable student
  • With the string value Luke
  • Being assigned to property firstName
  • With the string value Skywalker
  • Being assigned to property lastName
  • With a number value of 25
  • Being assigned to property age
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Code read this:

vehicle[‘color’] = ‘white’;

A
  • The string value of white
  • Is being assigned to the object vehicle
  • At string value color
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Code read this:

delete pet.name;

A
  • The delete operator is being used
  • On the name property
  • Of the pet object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Code read this:

var colors = [‘red’, ‘white’, ‘blue’];

A
  • An array literal
  • With the string values
  • Red, white, and blue
  • Being assigned to the variable colors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Code read this:

console.log(‘value of colors[0]’, colors[0]);

A
  • The log method of the console object is being callled
  • With two arguments
  • A string with the value of ‘value of colors at 0.’
  • And colors at 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Code read this:
var area = width * height;
A
  • The value of variable width
  • Is being multiplied with the value of variable height
  • The result of this expression
  • Is assigned to the variable area
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Code read this:

motto += ‘ is the GOAT’

A
  • The value of the variable motto
  • Is being added to the string value ‘is the GOAT’
  • And the result of this expression is being assigned to the variable motto
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Code read this:

var isSparta = headcount === 300;

A
  • The value of the variable headcount
  • Is being checked if it is strictly equal to 300
  • And is assigned to the variable isSparta
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Read this code:

table.striped tbody > tr:nth-child (odd)

A
CSS Ruleset with the CSS selector of:
the tr element
- with the pseudoclass of nth-child
- with the argument of odd
which is the direct child of
the tbody element
which is a descendant of 
the table element
- with the class of striped
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
var calculator = {
   subtract: function (x, y) {
      return subtract;
   }
};
A
  1. Object literal is being assigned to the calculator variable
  2. Anonymous function with the parameters of x and y is being assigned to the property subtract
  3. Opening curly brace for the code block of the anonymous function
  4. Result of the variable subtract is being returned from the function
  5. Closing curly brace for the code block of the anonymous function
  6. Closing curly brace for the code block of the object literal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
@media only screen and (min-width: 576px) {
   .col-5m-half {
   width: 50%;
   }
}
A
  1. New media rule with a media type of screen and a media feature of min-width of 576px
  2. With an opening curly brace for the css block
  3. New css ruleset with a selector of col-5m-half
  4. Opening curly brace for the css declaration block
  5. Width property with a value of 50%
  6. Closing curly brace for the css declaration block
  7. Closing curly brace for the css block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

setTimeout(() => {
$FlashImage.getAttribute(‘src’,this.laughingURL);
}, 3000

A
  1. setTimeout function is being called
  2. With two arguments
  3. The arrow anonymous function code block
  4. With the getAttribute method of the $flashImage object
  5. With two arguments, ‘src’ and this.laughingURL
  6. And the second argument with number value of 3000
How well did you know this?
1
Not at all
2
3
4
5
Perfectly