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
Q

!=

A

not equal

26
Q

!==

A

not equal value or not equal type

27
Q

>

A

greater than

28
Q
A

less than

29
Q

> =

A

greater than or equal to

30
Q

<=

A

less than or equal to

31
Q

?

A

ternary operator

32
Q

&&

A

logical and

33
Q

||

A

logical or

34
Q

!

A

logical not

35
Q

typeof

A

Returns the type of a variable

36
Q

instanceof

A

Returns true if an object is an instance of an object type

37
Q

&

A

AND

38
Q

|

A

OR

39
Q

~

A

NOT

40
Q
A

XOR

41
Q

<

A

Zero fill left shift

42
Q

> >

A

Signed right shift

43
Q

> > >

A

Zero fill right shift

44
Q

Bitwise Operators

A

work on 32 bits numbers

Any numeric operand in the operation is converted into a 32 bit number

45
Q

what is the assignment sign?

A

=

46
Q

= is what

A

The assignment to a var

47
Q

What is the equality or equal to sign?

A

==

48
Q

== is what?

A

equality or equal to commend.

49
Q

=== is what?

A

strict equality or equal to commend.

50
Q

What operators should be used when you are checking for equality within JS?

A

===

51
Q

if ( a == b)

A

equal to

52
Q

if ( a != b)

A

not equal to

53
Q

if ( a === b)

A

strict equality

54
Q

if ( a !== b)

A

not equal to

55
Q

if ( a > b)

A

greater than

56
Q

if ( a < b)

A

less than

57
Q

if ( a >= b)

A

greater than or equal to

58
Q

if ( a <= b)

A

less than or equal to

59
Q

&&

A

and

60
Q

||

A

or