Chap. 2 eloquent javascript Flashcards

1
Q
let ten = 10;
console.log(ten * ten);
A

// → 100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
let mood = "light";
console.log(mood);
// → light
mood = "dark";
console.log(mood);
A

// → dark

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
let luigisDebt = 140;
luigisDebt = luigisDebt - 35;
console.log(luigisDebt);
A

// → 105

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
let one = 1, two = 2;
console.log(one + two);
A

// → 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
let by = 111;
console.log(8 * by);
A

888

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
let by = 111;
console.log(8 + by);
A

119

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

If you ask for the value of an empty binding, you’ll get the value ________

A

undefined

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

A single let statement may define multiple bindings. The definitions must be separated by_________

A

commas

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

Binding names can be any word. Digits can be part of binding names—catch22 is a valid name, for example—but the name must not start with a _______

A

digit

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

A binding name may include ________ or_________ but no other punctuation or special characters.

A
dollar signs ($)
 underscores (_)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is this missing?

let x = 30;
console.log("the value of x is"  x);
A

comma before x

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

console.log(Math.min(2, 4) + 100);

A

102

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

The _______ function is a standard JavaScript function that returns true only if the argument it is given is NaN

A

Number.isNaN

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

Write short hand:

counter = counter + 1;

A

counter += 1;

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

Having the looping condition produce false is not the only way a loop can finish. There is a special statement called_________ that has the effect of immediately jumping out of the enclosing loop.

A

break

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

You may put any number of____ labels inside the block opened by switch. The program will start executing at the label that corresponds to the value that switch was given, or at______ if no matching value is found.

A

case

default