JavaScript: Logical Comparisons Flashcards

1
Q

Arithmetic Operators

A

Combine with numbers to form an expression that returns a single number.

console.log(a + b);
console.log(a - b);
console.log(a / b);
console.log(a * b);

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

Modulus Operator %

A

Returns the remainder between two numbers.

console.log(a % b);

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

Comparison Operators: == and !==

A

Comparison operators combine with strings, booleans and numbers to form an expression that evaluates to true or false.

Compares equality of value, not data type.

console.log(b == c);
console.log(b != c);

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

Comparison Operators: === and !===

A

Compares equality AND data type (strict equality)

console.log(b === c);
console.log(b !== c);

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

Comparison Operators: <, >, <=, and >=

A

< and > : Greater than or less than

console.log(a > b);
console.log(a < b);

<= and >= : Greater than or equal to and less than or equal to

console.log(a >= b);
console.log(a <= b);

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

Comparison Operators: &&

A

Evaluates to true if expression1 AND expression2 are both true, otherwise false.

console.log(expression1 && expression2);

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

Comparison Operators: ||

A

Evaluates to true if expression1 OR expression2 is true, otherwise false.

console.log(expression1 || expression2);

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

Logical Not (!)

A

Logical Not (!) turns an expression that evaluates to true to false and vice versa.

If expression2 is true, the following would return as false:

console.log(!expression2);

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