javascript-operators-and-expressions Flashcards

1
Q

What data type is returned by an arithmetic operation?

A

The data type that is returned by an arithmetic operation is a number. This is the case even if the result is NaN.

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

What is string concatenation?

A

String concatenation is when two strings are combined with a plus operator or a string and the plus operator with another variable adds the string form of the variable to the string being added too. Strings are immutable so taking the index of a character in a string and changing it will not actually change the original string.

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

What purpose(s) does the + plus operator serve in JavaScript?

A

The purpose of the (+) plus operator is to add numbers/bigints together with addition, to combine strings, or to convert another variable to a string and add it to the start of end of a string.

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

What data type is returned by comparing two values (<, >, ===, etc)?

A

The data type that is returned by comparing two values is either true or false. These values are of the type boolean.

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

What does the += “plus-equals” operator do?

A

The += “plus-equals” operator takes the variable on the left and adds the thing on the right of the assignment operator to it. It is equivalent to: num = num + 2; || num += 2;

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