Operators Flashcards

1
Q

assignment operator

A
(=) assigns a value to a variable
Ex: Assignment
var x = 10;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

addition operator

A
(+) adds numbers
Ex: Adding
var x = 5;
var y = 2;
var z = x + y;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

multiplication operator

A
(*) multiplies numbers
Ex: Multiplying
var x = 5;
var y = 2;
var z = x * y;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

+

A

Addition

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

-

A

Subtraction

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

*

A

Multiplication

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

/

A

Division

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

%

A

Modulus

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

++

A

Increment

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

A

Decrement

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

=

Ex: x = y

A

Same As:

x = y

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

+=

EX: x += y

A

Same As:

x = x + y

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

-=

Ex: x -= y

A

Same As:

x = x - y

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

*=

Ex: x *= y

A

Same As:

x = x * y

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

/=

Ex: x /= y

A

Same As:

x = x / y

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

%=

Ex: x %= y

A

Same As:

x = x % y

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

addition assignment operator

A

(+=) adds a value to a variable

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

what can the + be used for?

A
also be used to add (concatenate) strings
Example
txt1 = "John";
txt2 = "Doe";
txt3 = txt1 + " " + txt2;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

+= assignment operator

A

also be used to add (concatenate) strings

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

When used on strings the + operator is called ?

A

concatenation operator

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

Can you add strings and numbers together?

A

Yes, Adding two numbers, will return the sum, but adding a number and a string will return a string

Example
x = 5 + 5;
y = “5” + 5;
z = “Hello” + 5;

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

What happen when you add a number and a string?

A

the result will be a string

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

==

A

equal to

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

===

A

equal value and equal type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
!=
not equal
26
!==
not equal value or not equal type
27
>
greater than
28
less than
29
>=
greater than or equal to
30
<=
less than or equal to
31
?
ternary operator
32
&&
logical and
33
||
logical or
34
!
logical not
35
typeof
Returns the type of a variable
36
instanceof
Returns true if an object is an instance of an object type
37
&
AND
38
|
OR
39
~
NOT
40
^
XOR
41
<
Zero fill left shift
42
>>
Signed right shift
43
>>>
Zero fill right shift
44
Bitwise Operators
work on 32 bits numbers | Any numeric operand in the operation is converted into a 32 bit number
45
what is the assignment sign?
=
46
= is what
The assignment to a var
47
What is the equality or equal to sign?
==
48
== is what?
equality or equal to commend.
49
=== is what?
strict equality or equal to commend.
50
What operators should be used when you are checking for equality within JS?
===
51
if ( a == b)
equal to
52
if ( a != b)
not equal to
53
if ( a === b)
strict equality
54
if ( a !== b)
not equal to
55
if ( a > b)
greater than
56
if ( a < b)
less than
57
if ( a >= b)
greater than or equal to
58
if ( a <= b)
less than or equal to
59
&&
and
60
||
or