Operators Flashcards Preview

Ruby Keywords > Operators > Flashcards

Flashcards in Operators Deck (50):
1

+

add
2 +4 = 6

2

+

add
2 +4 = 6

3

-

subtract

4

*

multiply
2 *4 = 8

5

**

power of
2**4 = 16

6

/

Divide
2/4.0 == 0.5

7

%

modulus
2 % 4 ==2

8

.

Dot access
"1".to_i == 1

9

::

Colon access
Module::Class

10

[]

list brackets
[1,2,3]

11

!

not
!true == false

12

less than

13

>

greater than

14

>=

greater than or equal to

15

<=

less than or equal to

16

<=>

comparison
4 <=> 4 == 0

17

==

equal
4 =4 = true

18

===

Equality
4 ===4 = true

19

!=

not equal
4 != 4 = false

20

&&

Locical and (higher precedence)
true && false = false

21

||

Logical or (higher precedence)
true || flash = true

22

..

range inclusive
(0..3).to_a = [0,1,2,3]

23

...

Range non inclusive
(0...3).to_a = [0,1,2]

24

@

Object scope
@var ; @@classvar

25

@@

Class scope
@var ; @@classvar

26

$

global scope
$stdin

27

-

subtract

28

*

multiply
2 *4 = 8

29

**

power of
2**4 = 16

30

/

Divide
2/4.0 == 0.5

31

%

modulus
2 % 4 ==2

32

.

Dot access
"1".to_i == 1

33

::

Colon access
Module::Class

34

[]

list brackets
[1,2,3]

35

!

not
!true == false

36

"

less than

37

>

greater than

38

>=

greater than or equal to

39

<=

less than or equal to

40

<=>

comparison
4 <=> 4 == 0

41

==

equal
4 =4 = true

42

===

Equality
4 ===4 = true

43

!=

not equal
4 != 4 = false

44

&&

Locical and (higher precedence)
true && false = false

45

||

Logical or (higher precedence)
true || flash = true

46

..

range inclusive
(0..3).to_a = [0,1,2,3]

47

...

Range non inclusive
(0...3).to_a = [0,1,2]

48

@

Object scope
@var ; @@classvar

49

@@

Class scope
@var ; @@classvar

50

$

global scope
$stdin