JS operators and expressions Flashcards
1
Q
What data type is returned by an arithmetic operation?
A
number
2
Q
What is string concatenation?
A
when you join two or more strings together
3
Q
What purpose(s) does the + plus operator serve in JavaScript?
A
adds numbers and concatenates strings
4
Q
What data type is returned by comparing two values (less than sign, greater than sign, strictly equal)?
A
boolean
5
Q
What does the += “plus-equals” operator do?
A
adds the value of the right side of the operation to a variable and assigns the new result back to the variable.
result += 2
is the same as
result = result + 2