values, types, and operators Flashcards
Values of the number type are, unsurprisingly, _______ values.
numeric
There are three special values in JavaScript that are considered numbers but don’t behave like normal numbers. They are _____, ______, and ______?
Infinity, -Infinity, NaN
______s are used to represent text. They are written by enclosing their content in quotes.
string
+, - , * , / , typeof are called _______
operators
The minus sign - can be both a unary and binary operator. True/False
True
Which operators are arithmetic ?
+, -, *, /, and %
Which operators are or can be unary?
typeof and -
The Boolean type has what to possible values?
True or False
This one is called the conditional operator (or sometimes just the ______ operator since it is the only such operator in the language). true ? 1 : 2
Ternary
____ and _____, that are used to denote the absence of a meaningful value. They are themselves values, but they carry no information.
null and undefined
When something that doesn’t map to a number in an obvious way (such as “five” or undefined) is converted to a number, you get the value ______,
NaN
When an operator is applied to the “wrong” type of value, JavaScript will quietly convert that value to the type it needs, using a set of rules that often aren’t what you want or expect. This is called __________.
type coercion
console.log(8 * null)
0
console.log(“5” - 1)
4
console.log(“5” + 1)
51