code reading Flashcards

1
Q

-!doctype html-

A

there is a doctype element declaration with the value html?

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

title - (html skeleton) -/title

A

There is the opening tag for the title element with the text content of html skeleton, followed by the closing tag for the title element.

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

-p- © Pokemon. ® Nintendo. -/p-

A

there’s an opening tag for a paragraph element with a text content of an escape entity ampersand copy; pokemon. Ampersand reg; Nintendo. Then a closing tag for the paragraph element.

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

-a href=”%E2%80%9Dindex.html%E2%80%9D”>homepage-/a-

A

opening tag for anchor element with an href attribute of index.html with a text content of homepage and then a closing tag for the anchor element.

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

input (opening input tag)

A

there is an input element… (not opening tag for input element, since there’s no closing tag).

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

h2#JS { color: blue;}

A

There is a selector for THE h2 element with the ID of JS. Inside of the declaration, there is a property of color with the value of blue.

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

Body { color: #090302; font-family: sans-serif;}

A

“on line 1 there is a css selector for all elements of type body/(for all article elements) and the opening curly brace for the declaration block. On line 2 there is a color property with the value of hex code seen here. On line 3 there is a font family property with the value sans serif, and on line 4 there is a closing curly brace for the declaration block.”

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

border: 1px solid;

A

“there is a border shorthand property with the value of 1px and solid”

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

.title

A

There is a css selector for all elements with the class ‘title’.

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

body{ background-color: rgb (200, 233, 255);}

A

there is a background-color property with the value of the rgb css function with the values 200, 233, 255

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

font-family: ‘cabin’, sans-serif.

A

there is a font family prop with a value cabin, and a fall back value sans-serif

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

.custom-button:hover

A

there’s a css selector all elements with the class custom button and the pseudo class hover

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

table.striped thead > tr

A

there’s a css selector for all tr elements which are direct children of a thead element that is a descendant of the table element with the class striped.

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

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

A

there’s a css selector for all tr elements with the pesudo class nth child with the argument odd, which is a direct child of a tbody element which is a descendant of a table element with class striped

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

html (opening html tag)

A

there is an opening tag for the html element.

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

/head (closing head tag)

A

there is a closing tag for the head element

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

-img- src=”url” width=” 700px alt=”text” -

A

There is an image tag with a source attribute set to “url”, a width attribute set to 700pixels, and an alt attribute set to “text”.

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

Body { color: #090302; font-family: sans-serif;}

A

“on line 1 there is a css selector for all elements of type body/(for all article elements) and the opening curly brace for the declaration block. On line 2 there is a color property with the value of hex code seen here. On line 3 there is a font family property with the value sans serif, and on line 4 there is a closing curly brace for the declaration block.”

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

border: 1px solid;

A

“there is a border shorthand property with the value of 1px and solid”

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

.title

A

There is a css selector for all elements with the class ‘title’.

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

body{ background-color: rgb (200, 233, 255);}

A

there is a background-color property with the value of the rgb css function with the values 200, 233, 255

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

font-family: ‘cabin’, sans-serif.

A

there is a font family prop with a value cabin, and a fall back value sans-serif

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

.custom-button:hover

A

there’s a css selector all elements with the class custom button and the pseudo class hover

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

table.striped thead > tr

A

there’s a css selector for all tr elements which are direct child of athead element that is a descendent of the table element with the class striped.

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

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

A

there’s a css selector for all tr elements with the pseudo class nth child with the argument odd, which is a direct child of a tbody element which is a descendant of a table element with class striped

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

-p-blahblah- em-beautiful-/em- blah blah -/p-

A

There is an opening tag for the p element…then an opening tag for em tag with text content beautiful, with a close tag for the em element, and text content

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

var firstName = ‘Keenan’

A

on line one the string ‘keenan’ is being assigned as the value of the variable named firstName.

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

Var age = 25

A

the numeric literal, 25, is assigned to the variable named ‘age’.

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

var address = number + street

A

the value of the variable number is being concatenated/added with the value of the variable street, and the result of that expression (any work that needs to be done by js) is assigned to the variable address.
-NOTE, with concatenation, and maybe all js, just reading it in normal order. Don’t start from the absolute farthest right thing and working your way left. So don’t say street is being added

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

varbio=’Mynameis’+firstName+’‘+lastName+’andIam’+age+’yearsold.’

A

the string my name is is being concatenated with the value of the variable first name which is then concatenated with the string space which is then concatenated with the value of the variable last name which is then concatenated with string I am and then concatenated with value of variable age then concatenated with the string years old. And the result of that concatenation is being assigned to the variable named ‘bio’.

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

Console.log( typeof bio);

A

the log method of the console object is being called with 1 argument: the result of the expression of the typeof operator being used against the value of the variable bio

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

varcheap=price< 100

A

the value of the variable price is being checked to see if it is less than the number 100, and the result of that expression is being assigned to the variable named cheap

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

var nullVariable = null;

A

the value null is being assigned to the variable named nullVariable.

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

function addTwoNumbers(a, b) { return a + b)

A

line 1 there is a function definition named addTwoNumbers with two parameters, a and b, and the opening curly brace for the function code block
on line 2 the value of the variable ‘a’ is being added with the value of the variable ‘b’, and the result of that expression is being returned by the function.

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

Function typeofdata(data) { return typeof data }

A

there is a function definition named typeofdata that takes a single parameter of data, opening curly brace for the function code block, on next line, the typeof operator is being used against the value of the variable ‘data’, and the result of the expression is being returned by the function. Then a closing curly brace for the function code block.

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

if(value1 < value2) {
console.log(‘value1 is smaller’);
} else console.log(‘value2 is smaller’);

A

on line 18 there is an if statement with a condition checking if the value of the variable value1 is less than the value of the variable value2, then the opening curly brace for conditional code block
on line 19 the log method of the console object is being called with one argument; string “value1 is smaller”);
on line 20 is an else statement. and then the log method on the console object is called with one argument, a string with the value ‘value 2 is smaller’)

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

if(value2>=value1&&value2<=value4)

A

if(value2>=value1&&value2<=value4)
on line 32 there is an if statement with a condition checking if the value stored in variable 2 is greater than or equal to the value stored in variable 1. AND checking if the value stored in variable value2 is less than or equal to the value stored in variable value4

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

(value2>=value1&&value2<=value4)

A

there is an if statement with a conditional checking if the value of the variable value 2 is greater than or equal to the value of the variable2 AND if the value of variable value2 is less than or equal to the value of the variable value4.

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

switch(operator) {
case “+”:
result = num1 + num2;
break;}

A

on line 16 there is a switch statement with an expression checking the value of the variable ‘operator’.
There is a case statement checking for the string “+”, on the next line, the value of the variable num1 is being added to the value of the variable num2, and the result of that expression is being assigned to the variable named result.
on the next line there is a break statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q
varstudent={
firstName:'Keenan',
lastName:'Ng',
age:29
}
A

line one there is a object literal being defined. on line 2 there is a property of firstName assigned a value of string Keenan…. Last name: skywalker… age 25.
And that object literal is being assigned to the variable ‘student’.

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

varstudentsName=student.firstName+’‘+student.lastName;

A

The value stored at the firstName property of the student object is being concatenated with the string ‘space’ which is being concatenated with the value stored at the lastName property of the student object.

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

console.log(‘Mycar’,myCar);

A

the log method on the console object is being called with the value contained in the variable ‘myCar’

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

varcolors=[‘red’,
‘white’,
‘blue’];

A

on line 1 there is an array literal with values string red, string white, and string blue, as its contents, and that array literal is being assigned to the variable named colors

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

console.log(‘FirstArrayIndex:’,colors[0]);

A

the log method of the console object is being called with 2 arguments: the string first array index”, and the value at the 0 index of the colors array.

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

Colors[2] = ‘green’

A

the string value of green is being assigned to the 2 index of the colors array.

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

Var amountOfStudents = students.length

A

the value of the length property of the students object/array is being assigned to the variable named amountOfStudents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q
(don't read: var amtOfStudents = students.length)
varlastStudentInArray=students[amtOfStudents - 1];
A

The value of the variable amtofstudents is being subtracted by 1 and the result of that expression is being used as the index of the students array, and the value at that index, is being assigned to the variable named lastStudentInArray.

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

var library = [ ];

A

There is an empty array literal being assigned to the variable named library

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

console.log(library[0].title);

A

the log method on the console object is being called with one argument:
the value of the title property of the object at the 0 index of the library array

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

Library.push(book)

A

the push method of the library array is being called with a single argument of the value stored in the variable book.

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

console.log(‘==1’, “5”==5);

A

the log method of the console object is being called with 2 arguments. The first argument is the string ‘double equals 1’ the second argument is an expression checking to see if the string ‘5’ is loosely equal to the numeric literal 5’.

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

if (value2 < value3 || value2 > value4)

A

there is an if statement with a condition checking if the value of the variable value2 is less than the value of the variable value3 OR the value of the variable value2 is greater than the value of the variable value4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q
read the title line only.
var library = [
{
title: 'the road ahead',
author: 'Bill Gates',
libraryID: 1254
),
A

on line 3 the string with the value ‘the road ahead’ is being assigned to the property ‘title’.

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

console.log(library[0].title)

A

the log method of the console object is being called with a single argument, the value of the ‘title’ property of the object at the 0 index of the ‘library’ array.

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

var box1 = document.getElementById(‘box1’)

A

the getElementById method of the document object is being called with the single argument of the string ‘box1’. And the return from that method is being assigned to the variable named box1.

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

box1.classList.remove(‘blue’)

A

the remove method of the object within the classList property of the box1 object is being called with the single argument, string blue.

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

box1.classList.add(‘red’)

A

The add method of the object within the classList property of the box1 object is being called with the argument of the string red.

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

Box2.style.height=”150px”;

A

The string 150 pixels is being assigned as the value for the height property of the object within the style property of the box2 object.

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

var textElement = document.getElementById(‘h1tag’)

A

the getElementById method on the document object is being called with the single argument of the string h1tag. And the return of that method is being assigned to the variable named textElement.

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

Var elementText = textElement.textContent;

A

The value of the textContent property of the textElement object is being assigned to the variable named elementText.

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

ElementText += “, you have properly manipulated text!”

A

the string “, you have properly manipulated text!” is being added to the current value, AND SAVED within the variable ‘elementText’.

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

textElement.textContent = elementText

A

The value of the variable elementText is being assigned as the value to the textContent property of the textElement object.

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

Var inputElement = document.getElementById(‘textInput”);

A

The getElementById method of the document object is being called with one argument, string ‘textInput’. And The return of that method is being assigned to the inputElement variable.

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

Var inputValue = inputElement.value

A

the value of the ‘value’ property of the inputElement object is being assigned to the variable named inputValue.

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

InputElement.value = 867.

A

The number 867 is being assigned to the value property of the inputElement object.

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

InputElement.value = valueUpdate

A

The value of the variable valueUpdate is being assigned as the ‘value’ of the value property of the inputElement object.

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

Var valueUpdate = inputValue += 5309

A

The number 5309 is being added to the current value of the variable inputValue and assigned as the value for the value of inputValue as well as the value of the variable valueUpdate

Alternate that follows the other flashcard:
The number 5309 is being add to the current value of and saved within, the variable ‘inputValue’, which is then assigned to the variable named valueUpdate

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

var clickButton = document.querySelector(‘#clickbutton’);

A

the querySelector method of the document object is being called with a single argument, string #clickbutton, and the result of that method is being assigned to the variable clickButton

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

clickButton.addEventListener(‘click’, handleClick);

A

the addEventListener method of the clickButton object is being called with two arguments. The string ‘click’ and the variable handleClick. (value stored within the variable handleclick?)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q
function handleClick(event)	{
console.log(event);
alert(‘it works’); }
A

There is a function declaration named handleClick that takes 1 parameter, the variable named event (or is it just ‘event’?).
The log method of the console object is being called with one argument (or parameter?) , the variable named event.
The alert function is being called with one argument, the string ‘it works’.

71
Q

while(current<=max){
console.log(‘currentvalue:’,current);
current++;
}

A

There is a while loop with a condition checking if the value of the variable ‘current’ is less than or equal to the value of the variable ‘max’.

the log method of the console object is being called with 2 arguments, the string ‘current value’ and the value stored in the variable ‘current’.

There is a variable named ‘current’ followed by the increment operator.

72
Q

current++

A

there is the variable ‘current’ followed by the increment operator.

73
Q

for( I = 1; I <=10; i++)

A

on line 3 there is a for loop with an initialization setting 1 as the value for the variable ‘i’, and a condition checking if the value of the variable i’ is less than or equal to 10 followed by a final expression with the variable ‘i’ followed by the operator ++ (increment operator).

74
Q

for (j = 2; j <= 20; j += 2)

A

there is a for loop with an initialization, setting 2 as the value for the variable ‘j’, and a condition checking if the value of j is less than or equal to 20, followed by a final expression with the variable ‘j’ followed by an addition assignment of 2, to the variable ‘j. (followed by a final expression of j+= 2).

75
Q

for (k = 10; k >= 0; k–)

A

there is a for loop with an initialization, setting 10 as the value for the variable k, and a condition checking if the value of the variable ‘k’ is less than or equal to 0, followed by a final expression of the variable ‘k’ followed by a decrement operator.

76
Q
varfilmCredits={
writer:"JohnWick",
director:"JohnCena",
producer:"JohnWall",
  intern: "Johnn Cage"
}
A

On line 1 there is an object literal being declared. On line 2+ there is a property of ___ with a value of ____. And that object literal is being assigned to the variable named filmCredits.

77
Q

For (var x in filmCredits) {
console.log(filmCredits[role],’as’, role);
}

A

There is a for in loop. With variable ‘x’ as the key in object ‘filmCredits’. On the next line,
the log method of the console object is being called with an argument of an expression, which is the value of the variable role, as the index (or property) in the filmCredits object, concatenated with the string ‘as’, which is the concatenated with the value of the variable ‘role’.

78
Q

var section 1 = document.getelemenetbyid(‘section1’)

A

there is a getelementbyid method of the document object being called with one argument, the string ‘section1’, and the return of that method is being assigned to the variable named section1.

79
Q

var section1LastElementChild = section1.lastElementChild;

A

Value of the lastElementChild property of the section1 object is being assigned to the variable named section1LastElementChild.

80
Q

var h4Sibling = siblingP.nextElementSibling;

A

The (‘value of the?’ Not sure if this is right) nextElementSibling property of the siblingP object is being assigned to the variable h4sibling

81
Q

heading.textContent = ‘shopping list’

A

the string shopping list is being assigned to the textContent property of the heading object.

82
Q

Body.appendChild(heading);

A

the appendChild method of the body object is being called with one argument, the value stored within variable named heading.

83
Q
Uzair ending vs cody ending:
var listItem2 = document.createElement(‘li’);
A

uzair:
‘And the return value of that method is being assigned to the variable ____’

cody:
‘and the return of that method is being assigned to the variable ____’

84
Q

body appendChild(heading);

A

the appendChild method of the body object is being called with one argument, the value stored within the variable ‘heading’

85
Q

var todoItemsarray = [ ];

A

the array literal is being assigned to the variable named todoItemsArray

86
Q

for(var i = 0; i < todoItemsArray.length; i++)

A

there is a for loop with the initialization of the number 0 being assigned to the variable I; the condition, checking if the value stored in the variable ‘i’ is less than the value of the length property of the todoItemsArray; and a final expression of the value of the variable I, followed by the increment operator.

87
Q

todoSubmitButton.addEventListener(‘click’, function() {});

A

The addEventListener method of the todoSubmitButton object being called with two arguments: the string ‘click’, and a function definition.

88
Q

var box1 = $(‘#box1’)

A

the dollar sign (or jQuery) function is being called with a single argument, string ‘id box1’, and the return of that function call is being assigned to the variable box 1

89
Q

$(‘box1’).removeClass(‘blue’).addClass(‘red’);

A

the jquery function is being called with the argument string box1 followed by the removeClass method of that object being called, with an argument string ‘blue’, followed by the addClass method of the object returned from removeClass being called, with the string ‘red’.

90
Q

function handleContainerClick(event) { }

A

there is a function declaration named handleContainerClick that is prepared to take one parameter, ‘event’.

91
Q

multiply: function(num1, num2)

A

there is an anonymous function definition with 2 parameters, num1 and num2, and that function definition is being assigned as the value for the property multiply.

92
Q

divide(num1, num2) //shorthand style

A

divide(num1, num2) //shorthand style

93
Q

return num1 * num2

A

the variable num1 is being multipled by the variable num2 and the result of that expression is being returned from the function

94
Q

the variable num1 is being multipled by the variable num2 and the result of that expression is being returned from the function

A

the add method of the ‘this’ object is being called with 2 arguments, num1 and num2, and the return of that method call is being assigned to the variable sum

95
Q

console.log(this.property + ‘ is a ‘ + this.species + ‘ the breed + this.breed)

A

the log method of console obj is being called with one argument, the value of the property title on ‘this’ obj concated with string is a concat with value of prop species on this object, concatted with string of the bred, concated with the value of the property breed on ‘this object. and the result is being passed into the log method on the console object.

96
Q

var describe = ada.describe;

A

the value of the describe property of the ada object is being assigned to the value of the variable named describe.

97
Q

describe: eevee.describe.bind(ada)

A

the bind method of the object within the describe property of the eevee object is being called with the argument, variable ‘ada’. And the return of that method call is being assigned as teh value of the property ‘describe’.

98
Q

startButton.addEventListener(‘click’, function(){}

A

the add eventlistener method of the start button object is being called with two arguments, the string click, and the function definition

99
Q

card.className = cards[i]

A

the value at the index i of the cards array is being assigned to the value of the className property of the card object.

100
Q

var randomPosition = Math.floor(Math.random() * array.length)

A

the random method of the math object is being called and the return of that method call is being multiplied against the value of the length prop of the ‘array’ array, and the result of that expression is being passed as an argument to the floor method of the math object, which is being called. And the return of that method call is being assigned to the variable randomPosition.

101
Q

@media only screen and (min-width: 576px)

A

there is a media query for only the media type, screen, and a media feature, min-width, set to a value, 768 pixels.

102
Q

@media only screen and (min-width: 768px)

A

there is a media query for only the media type screen and a media feature, min-width set to 768 pixels.

103
Q

multiply: function(num1, num2)

A

there is an anonymous function definition with 2 parameters, num1 and num2, and that function definition is being assigned as the value for the property multiply.

104
Q

divide(num1, num2) //shorthand style

A

line 16 there is a divide method with the parms num1 and num2

105
Q

return num1 * num2

A

the variable num1 is being multipled by the variable num2 and the result of that expression is being returned from the function

106
Q

var sum = this.add(num1 , num2)

A

the add method of the ‘this’ object is being called with 2 arguments, num1 and num2, and the return of that method call is being assigned to the variable sum

107
Q
function Car(make, model, weight, horsePower, color, doors) {
  this.make = make;
  this.model = model;
  this.weight = weight;
  this.horsePower = horsePower;
  this.color = color;
  this.doors = doors;
}
A

there is a function definition named Car with 6 parameters.

108
Q

this.make = make;

A

the value of the variable make is being assigned to the property make of the this property

109
Q

Car.prototype.overview = function () {

A

There is an anon function definition being assigned as the value of the overview property of the object within the prototype property of the Car Object.

110
Q

Car.prototype.specs = function () {

A

there is a anonymous function definition, being assigned to the specs property of the object within the prototype property of the Car Object.

111
Q

var prius = new car(

A

the car function is being called with ‘x’ arguments using the new keyword, and the return of that function is being assigned to the variable prius.

112
Q

classCar{

A

there is a class named Car being defined and opening curly brace

113
Q

constructor(make,model,weight,horsePower,color,doors){

A

there is a constructor being defined with 6 parameters (make ,model weight etc)

114
Q

method() {

A

there is the method ‘overview’ being defined and opening curly brace for the code block.

115
Q

addHorsePower(power) {

A

the method ‘addhorsepower’ is being defined and takes one parameter, power. and opening curly brace for the code block.

116
Q

var fiat = new Car(‘fiat’, ‘500’, ‘500kg’, 200, ‘white’, 4);

A

the car function is being called with the ‘new’ keyword, passing in 6 arguments, and the return value is being assigned as the value of the variable ‘fiat’

117
Q

class Parent {

A

there is a class definition named Parent

118
Q

constructor(blah blah blah blah blah)

A

there is a constructor being defined with 6 parameters. There is a constructor method definition with 6 parameters.

119
Q

this.child = new Child(this.firstname, this.childName)

A

The child function is being called (or ‘the Child class is being instantiated’.) using the ‘new’ keyword, with two arguments, the value of the firstName property on ‘this’ object, and value of the childName property on ‘this’ object, and the return of the function call is being assigned to the child property of ‘this’ object.

120
Q

askForFood() {

A

There is a askForFood method being defined.

121
Q

var parent = new Parent(“han”, “solo”, 42, blah, blah);

A

the Parent class is being instantiated using the new keyword with 5 arguments blah blah blah. And the return value is being assigned to the variable named parent.

122
Q

this.feedChild = this.feedChild.bind(this)

A

the bind method of the feedchild property within this object is being called with the value of this and the value of that return is being assigned to the feedChild property of this object

123
Q

this.child = new Child(this.firstname, this.childName, this.feedChild)

A

the Child class is being instantiated with the new keyword and takes 3 arguments ( blah blah blah) and the return of that function call is being assigned to the child property of this object.

124
Q

class Child {

A

there is a class named Child being defined.

125
Q

constructor(parentName, name, feedMeCallback)

A

there is a constructor method being defined with 3 parameters

126
Q

var parent = new parent(‘han’, ‘solo’, 42, ‘smuggler’, ‘ben’)

A

the parent function is being called using the new keyword, and takes 5 arguments. And the return value of that function call is being assigned to the value of the parent variable.

127
Q

var maker = new Maker(‘Firelord’, ‘Ozai’, 45, ‘changing everything’, ‘Zuko’);

A

there is a function named Maker being called with the new keyword, with 5 arguments.

128
Q

constructor( blah blah blah blah blah)

A

the constructor method is being defined with 5 parameters.

129
Q

this.replenishFood = this.replenishFood.bind(this);

A

the bind method of the obect within the replenishFood property of this object is being called with single argument variable this, and the return of the method call is being assigned to the replenishFood property of this object.

130
Q

var bookArrayJSON = JSON.stringify(bookarray);

A

the stringify method of the JSON object is being called with 1 argument, the value of the variable bookarray, and the return of that method call is being assigned to the variable named bookArrayJSON

131
Q

var personObjParsed = JSON.parse(personObj);

A

the parse method of the jSON object is being called with 1 argument, the value of the variable personObj, and the return of that method call is being assigned to the variable named personObjParsed.

132
Q

$.ajax({})

A

there is an ajax method of the jquery object being called with 1 argument, an object literal.

133
Q

success: function(data){

A

there is an anonymous function being defined with one parameter, ‘data’ and the function definition is being assigned to the property, ‘success’.

134
Q

for(var i = 0 ; i < data.length; i++)

A

there is a for loop, in the initialization, the value ‘0’ is being assigned to the variable ‘i’, in the condition, it is checking if the value of the variable ‘i’ is less than the value of the length property of the data object. in the final expression, the value of ‘i’ is being incremented.

135
Q

row.append(userId, name, email);

A

the append method of the row object is being called with 3 arguments(the value stored within userid, name, and email);

136
Q

const greetings = []

A

on line 11 there is a array literal being assigned to the constant variable, greetings

137
Q

let i = 0

A

the number 0 is being assigned as the value of the let variable, ‘i’

138
Q

let greeting = greetings[randomNumber]

A

the value at the value of the random number variable of the greetings array, is being assigned to the let variable, greeting.

139
Q

const variable = ‘meow’

A

the string ‘meow’ is being assigned to the constant variable, ‘variable’.

140
Q

const address = ${number} ${street}

A

there is a template literal with javascript expressions for the number variable and the street variable, being assigned to the constant variable, address.

141
Q

const applePen = ${fruit} ${item}

A

there is a template literal with javascript expressions for the value of the variable fruit and the value of the variable item, which is being assigned to the constant variable, applePen.

142
Q

const {title, author, libraryID} = book1;

A

the title author and library id properties are being destructured from the book1 object, and assigned as constant variables

143
Q

const{ title: title2, author: author2, libraryID: libID2} = book2

A

the title author and library id properties of the book 2 object, are being destructured and assigned as the constant variables: title2, author2, and libID2.

144
Q

const [book3, book4, book5] = library

A

the first second and third index of the library array, are being destructured, and assigned as the constant variables: book3. book4, book5.

145
Q

const [,,,book6] = library

A

the fourth index of the library array is being destructured and being assigned as teh constant variable book6

146
Q

const someFunction = () ⇒ {}

A

there is an arrow function definition being assigned to the constant variable someFunction

147
Q
const express = require('express');
const app = express();

app.use((req, res) => {
res.send(‘hello world!’);
});
app.listen(3000, () => {
console.log(‘Listening on port 3000!’);
});

A

require function is being called with the argument, string ‘express’

express function is being called and the return is being assigned to the const variable app.

use method of the app object is being called with one argument, an anonymous arrow function that takes two parameters, request and response

send method of the res object is being called with the argument ‘hello world!’.

listen method of the app object is being called with 2 arguments, number 3000 and an anonymous arrow function.

log method of the console object being called with ‘listening on port 3000!’)

148
Q
function updateHeading($h1) {
if ($h1.is('[webpack]')) {
$h1.removeAttr('webpack');
$h1.text('Hello, World!');
} else {
$h1.attr('webpack', true);
$h1.text('Hello, Webpack!');
}}

setInterval(updateHeading, 1000, $(‘#hello-world’));

A

defining a function named updateHeading that takes one parameter, $h1

there is an if statement. in the condition, the ‘is’ method of the $h1 object, with one argument, the string [webpack]

removeattr method of the $h1 object is being called with one argument, string’webpack’

text method of $h1 object is being called with string ‘hello world!’

attr method of $h1 object being called with 2 arguments, string webpack and boolean true.

text method of $h1 object is being called with 1 argument, string ‘hello, webpack!’

setInterval function being called with 3 arguments: value of the variable updateHeading, number 1000, and the return of the $ function being called with the argument, string ‘#hello-world’.

  • … and the return value of calling the dollar function with the string #hello-world
149
Q

import todoApp from ‘./todoApp’

A

The todoApp variable is being imported from the todoApp module.

150
Q

export default TodoApp;

A

the TodoApp variable is being assigned to the default export of the module.

151
Q

export default toArray

A

the toArray function/variable is being assigned as the default export of the module.

152
Q

function createElement(tagName, attributes, children = []

A

The function createElement is being defined with 3 paramters:
tagname, attributes and children, that defaults to an empty array.?

153
Q

toArray(children).forEach(child => {}

A

the toArray function is being called with the single argument, the variable children, and the foreach method of the return of the toArray function call is being called with an anonymous arrow function that takes the argument, the variable child.

154
Q

for (const name in attributes) {}

A

for each name in attributes…

155
Q

parent.setAttribute(name, attributes[name])

A

setattribute method of parent object being called with two arguments( value of the variable name, and the value of attributes at name.

156
Q

import React from ‘react’

A

we are importing React from the react package.

157
Q

import React from ‘react’

Which directory is react looking inside and why?

A

when there is no relative file path, then it is looking inside node_modules.

158
Q
A

defining a function named updateHeading that takes one parameter, $h1

there is an if statement. in the condition, the ‘is’ method of the $h1 object, with one argument, the string [webpack]

removeattr method of the $h1 object is being called with one argument, string’webpack’

text method of $h1 object is being called with string ‘hello world!’

attr method of $h1 object being called with 2 arguments, string webpack and boolean true.

text method of $h1 object is being called with 1 argument, string ‘hello, webpack!’

setInterval function being called with 3 arguments: value of the variable updateHeading, number 1000, and the return of the $ function being called with the argument, string ‘#hello-world’.

  • … and the return value of calling the dollar function with the string #hello-world
159
Q

The todoApp module is being imported from a path

A

we are calling the TodoApp function with the new keyword…

160
Q

export default TodoApp;

A

the TodoApp variable is being assigned to the default export of the module.

161
Q

export default toArray

A

the toArray function/variable is being assigned as the default export of the module.

162
Q
A

3: the function createElement is being defined with 3 parameters (tagname, attributes, and children that defaults to an empty array.
5: for each name in attributes
6: setattribute method of parent object being called with two arguments( value of the variable name, and the value of attributes at name.
8. the toArrayfunction is being called with the argument, the value of the variable children, and the forEach method is being called on the return of the toArray function call.

The forEach method of the return of the toArray function call with the argument children, is being called

163
Q

import React from ‘react’

A

we are importing React from the react package.

when there is no relative file path, then it is looking inside node_modules.

164
Q

JSX file:

click me!

A

we are creating a react element of type button and it has the child ‘click me!

165
Q

JSX File:

A

we are creating a react element of type CustomButton

166
Q
import React from 'react';
import ReactDOM from 'react-dom';
function CustomButton(props) {
  return (
    {props.text}
  );
}
const element = (
  <div>

</div>
);

ReactDOM.render(
element,
document.querySelector(‘#root’)
);

A
  • React is being imported from the react package
  • ReactDOM is being imported from the react-dom package
  • the function named CustomButton is being defined and takes one parameter, props
  • there is a return statement that returns an expression.
  • There is a react element type of button is being created with a child of a JAVASCRIPT expression, the value of the text property of the props object.
    • There is a JSX expression as a child element, the value of the text property of the props object.
  • The result of that (JSX expression)? is being returned by the CustomButton function.
  • there is a JSX expression being assigned to the const variable named element.
    • There are react elements being assigned to the const variable named element.
  • line 10 there a a react element type of div
  • There is an expression being assigned to the const variable element
    • There is a react element type of div
    • there is a react element type of CustomButton with the attribute text with the value of string “i”
    • there is a react element type of CustomButton with the attribute text with the value of string “know”
    • there is a react element type of CustomButton with the attribute text with the value of string “React!”
    • There is a react element of type closing div tag.
    • There is a closing parenthesis for the expression
  • the render method of the ReactDOM object is being called with 2 arguments, value of the variable element, and the return of the querySelector method of the document object being called with the string ‘#root’.
  • There is a closign parenthesis for the argument list.
167
Q
class CustomButton extends React.Component {
  render() {
    return  { this.props.text };
  }
}
A
  • There is a class definition named CustomButton that extends from the Component property of the React Object
  • the render (class) method is being defined with no parameters.
  • We are returning something (tim actually says this)
  • there is a react element type button.
  • There is a child of a javascript expression: the value of the text property of the props object of this object.
  • there is a closing react element button tag
168
Q
const element = (
  <div>
  </div>
);
ReactDom.render(
element,
document.querySelector('#root')
);
A
  • We are assigning ‘something’ to the constant variable element
  • There is an opening react element of type div
  • There is a react element of type CustomButton with a string of ‘I’ being assigned to the prop, ‘text’
  • There is a react element of type CustomButton with a string ‘know’ being assigned to the prop, ‘text’,
  • There is a react element of type CustomButton with a string ‘React!’ being assigned to the prop, ‘text’,
  • There is a closing div tag for the react element.
  • 18: There is a closing parenthesis for assignment.
  • The render method of the ReactDOM object is being called with two arguments,
  • the value of the variable element, and the return of the querySelector method of the document object being called with the argument, string ‘#root.’
  • Then a closing parenthesis for the argument list.
169
Q

import React from ‘react’;
import ReactDOM from ‘react-dom’;

class CustomButton extends React.Component {
  constructor(props) {
    super(props);
    this.state = { isClicked: false };
    this.handleClick = this.handleClick.bind(this);
  }
  handleClick() {
    this.setState(state => ({
      isClicked: !state.isClicked
    }));
  }

render() {
return (

    {this.state.isClicked ? 'Got ya!' : 'Click Me!'}

);   } }

ReactDOM.render(
,
document.getElementById(‘root’)
);

A

Reactisbeingimportedfromthereactpackage

reactDOMisbeingimportedfromthereact-dompackage

thereisaclassdefinitionnamedCustomButtonthatextendsfromthecomponentpropertyofthereactobject

themethodnamedconstructorisbeingdefinedandtakesoneparameter’props’

thesuperfunction/methodisbeingcalledwithoneargument,thevalueofthevariableprops

anobjectcontainingthepropertyisClickedwithavalueoffalse,isbeingassignedtothestatepropertyofthisobject

thebindmethodofthehandleClickobjectofthisobjectisbeingcalledwiththesingleargumentthis.

endingcurlybraceforthemethodcodeblock.

themethodhandleClickisbeingdefinedandtakesnoparameters

thesetStatemethodofthisobjectisbeingcalledwithoneargument,ananonymousarrowfunctionthattakestheparameterstate

thevalueoftheisClickedpropertyofthestateobjectmodifiedwiththebangoperator,isbeingassignedtotheisClickedproperty.

therendermethodisbeingdefined

somethingisbeingreturned

Thereisareactelementtypebuttonwitha propwiththevalueofajavascriptexpression, thevalueofthehandleClickpropertyofthisobject.

ThebuttonhasachildelementofajavascriptexpressioncheckingwhetherthevalueoftheisClickedpropertyofthestateobjectofthisobjectistruthy.

Ifitis,itreturnsthestring’Thanks!’andiffalse,itreturnsthestring’ClickMe!’

Thenthereisaclosingreactelementbuttontag.

closingparenthesisforthereturnstatement

closingcurlybracefortherendermethodcodeblock

closingcurlybracefortheclassdefinition

therendermethodoftheReactDomobjectisbeingcalledwithtwoarguments,

thereactelementtypeofCustomButton

andthereturnofthegetElementByIdmethodofthedocumentobjectbeingcalledwiththestring’root’.

170
Q
A
  • line 6: the then method of the promise object is being called with an argument, an anonymous arrow function definition.
  • The anonymous arrow function takes 1 parameter, message.
  • log method of the console object is being called with the argument, the value of the variable message.
  • there is a closing curly brace for the anonymous arrow function code block, and a closing parenthesis for the argument list.
  • the catch method of the promise object is being called with 1 argument, an anonymous arrow function definition.
  • The anonymous arrow function takes 1 parameter, error.
  • the log method of the console object is being called with one argument, the value of the message property of the error object.
171
Q

fetch(‘https://jsonplaceholder.typicode.com/users’)
.then(response => response.json())
.then(data => console.log(data));
.catch(error => console.error(error.message));

A
  • the fetch function is being called with 1 argument.
  • the ‘then’ method of the result of the previous fetch call is being called with 1 argument, an anonymous arrow function.
    • The anonymous arrow function definition takes one parameter, ‘response’ and returns the result of the json method of the response object being called with no arguments.
  • the ‘then method of the result of the previous ‘then’ call is being called with an anonymous arrow function definition.
    • The anonymous arrow function definition takes one parameter, ‘data’ and returns the result of the log method of the console object being called with one argument, the value of the variable ‘data’
172
Q
A

line 7: … and a closing p tag for the react element.

  • creation of a react element of type a
    • the string “_blank” assigned to the target prop
    • there is a href prop set to a javascript expression
      • the template literal with the string mailto: and then a a javascript expression for the value of the email property of the user object of the props object.
      • then a backtick to end the template literal, and a ending curly brace for the javascript expression
      • The a tag has a child of a javascript expression, the value of the email property of the user property of the props object.
      • then a closing a tag for the react element
      • then a closing p tag for the react element
      • then a close li tag for the react element
        line 19: there is a creatin of a react element of type ul.
        it has a child of a javascript expression
  • the map method of the users property of the props object is being called with 1 argument, an anonymous arrow function.
  • The anon arrow function takes 1 parameter, user.
  • There is a react element of type User being created.
  • It has a key prop with the value of a javascript expressions, the value of the id prop of the user object….
    • and the result of that react element creation is being returned.
  • line 29 we are assigning the variable UserList as the default export of the module
173
Q
A
  • we are importing Rofl from the user-list module
  • there is a class definition named App that extends from the component property of the react object.
  • the constructor method is being defined with one property, props. Opening curly brace for the constructor code block
  • the super function is being called with 1 argument, the value of the variable props
  • There is an object literal being assigned to the state property of this object.
  • An empty array literal is being assigned to the users property.
  • The boolean true is being assigned to the isLoading property.
  • the method componentDidMount is being defined and takes no parameters
  • the fetch function is being called with one argument, a string url path.
  • the then method of the result of the previous fetch call is being called with 1 argument, an anonymous arrow function.
    • The anonymous arrow function definition takes 1 property, res,
      • the json method of the res object is being called and the return of that method call is being returned.
    • the then method is being called on the return value of the previous method call, with one argument.
  • define the render method that takes no parameters
  • There is a ternary expression:
    • if this.state.isLoading is true, it will return a react element of type p, with a child of Loading… then a closing p tag for the react element.
    • else, a react element of type UserList is created with a users prop with the value of a js expressions, teh value of the users property of the state property of the this object.
    • The result of that ternary expression is being returned.