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
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
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
4
Q
Code read this:
delete pet.name;
A
- The delete operator is being used
- On the name property
- Of the pet object
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
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.
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
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
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
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
11
Q
var calculator = { subtract: function (x, y) { return subtract; } };
A
- Object literal is being assigned to the calculator variable
- Anonymous function with the parameters of x and y is being assigned to the property subtract
- Opening curly brace for the code block of the anonymous function
- Result of the variable subtract is being returned from the function
- Closing curly brace for the code block of the anonymous function
- Closing curly brace for the code block of the object literal
12
Q
@media only screen and (min-width: 576px) { .col-5m-half { width: 50%; } }
A
- New media rule with a media type of screen and a media feature of min-width of 576px
- With an opening curly brace for the css block
- New css ruleset with a selector of col-5m-half
- Opening curly brace for the css declaration block
- Width property with a value of 50%
- Closing curly brace for the css declaration block
- Closing curly brace for the css block
13
Q
setTimeout(() => {
$FlashImage.getAttribute(‘src’,this.laughingURL);
}, 3000
A
- setTimeout function is being called
- With two arguments
- The arrow anonymous function code block
- With the getAttribute method of the $flashImage object
- With two arguments, ‘src’ and this.laughingURL
- And the second argument with number value of 3000