Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
19 Cards in this Set
- Front
- Back
Operator |
a symbol representing a mathematical operation (+, -) or other type of operation |
|
Value |
A category of data |
|
Types of Values |
Numbers, strings, booleans, objects, functions, and undefined values |
|
\n, \t etc., in a string |
A backslash followed by certain characters in the middle of quoted text (a string) means that the character has special meaning. \n is new line, \t is tab. \" is quotation mark, not the end of the string. |
|
+ sign between strings |
Concatenates - merges (strings) together |
|
Binary vs. Unary Operators |
A binary operator has two operands (1+1), a unary operator has one (-2) |
|
Boolean |
A value that is either true or false
|
|
x<y and y>x |
Greater or less boolean operators |
|
!=, <=, >= |
more boolean operators: is not equal to, less than or equal to, more than or equal to |
|
Logical Operators |
and (&&), or (||), not (!) |
|
Expression |
a piece of code that expresses a value |
|
Statement |
The basic unit of a program (a program is built as a list of statements); a larger unit than an expression. most statements end with a semicolon. |
|
Modulo |
The % symbol is used to represent the remainder operation. For example, 314 % 100 produces 14, and 144 % 12 gives 0. |
|
NaN |
Stands for "not a number”, even though it is a value of the number type. You’ll get this result when you, for example, try to calculate 0 / 0 (zero divided by zero), Infinity - Infinity, or any number of other numeric operations that don’t yield a precise, meaningful result. |
|
Strings |
Strings are used to represent text data types. They are written by enclosing their content in quotes. ex. "I am a string" |
|
Escaping the character |
Whenever a backslash (“\”) is found inside quoted text, it indicates that the character after it has a special meaning. |
|
Conditional/Ternary Operator |
The value on the left of the question mark “picks” which of the other two values will come out. When it is true, the middle value is chosen, and when it is false, the value on the right comes out. Ex: console.log(true ? 1 : 2); // → 1 console.log(false ? 1 : 2); // → 2 |
|
Undefined Values |
There are two special values, written null and undefined, that are used to denote the absence of a meaningful value. They are themselves values, but they carry no information. |
|
Automatic type conversion || Type coercion |
When an operator is applied to the “wrong” type of value, JavaScript will quietly convert that value to the type it wants, using a set of rules that often aren’t what you want or expect. This is called type coercion |