Equality Operators

2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$39.99
List Price:  $79.99
You save:  $40
€34.51
List Price:  €69.04
You save:  €34.52
£30.03
List Price:  £60.08
You save:  £30.04
CA$56.07
List Price:  CA$112.15
You save:  CA$56.08
A$61.64
List Price:  A$123.30
You save:  A$61.66
S$51.95
List Price:  S$103.92
You save:  S$51.96
HK$310.72
List Price:  HK$621.52
You save:  HK$310.80
CHF 31.86
List Price:  CHF 63.74
You save:  CHF 31.87
NOK kr401.91
List Price:  NOK kr803.93
You save:  NOK kr402.01
DKK kr257.81
List Price:  DKK kr515.68
You save:  DKK kr257.87
NZ$69.66
List Price:  NZ$139.35
You save:  NZ$69.68
د.إ146.86
List Price:  د.إ293.76
You save:  د.إ146.90
৳4,885.14
List Price:  ৳9,771.51
You save:  ৳4,886.36
₹3,508.98
List Price:  ₹7,018.84
You save:  ₹3,509.86
RM169.15
List Price:  RM338.35
You save:  RM169.20
₦58,662.13
List Price:  ₦117,338.93
You save:  ₦58,676.80
₨11,327.80
List Price:  ₨22,658.43
You save:  ₨11,330.63
฿1,315.63
List Price:  ฿2,631.59
You save:  ฿1,315.96
₺1,678.63
List Price:  ₺3,357.69
You save:  ₺1,679.05
B$215.47
List Price:  B$430.99
You save:  B$215.52
R698.96
List Price:  R1,398.11
You save:  R699.14
Лв67.44
List Price:  Лв134.89
You save:  Лв67.45
₩57,256.54
List Price:  ₩114,527.40
You save:  ₩57,270.86
₪131.86
List Price:  ₪263.76
You save:  ₪131.89
₱2,337.73
List Price:  ₱4,676.05
You save:  ₱2,338.31
¥6,071.28
List Price:  ¥12,144.08
You save:  ¥6,072.80
MX$735.85
List Price:  MX$1,471.89
You save:  MX$736.04
QR145.92
List Price:  QR291.87
You save:  QR145.95
P534.01
List Price:  P1,068.15
You save:  P534.14
KSh5,164.70
List Price:  KSh10,330.70
You save:  KSh5,166
E£1,901.52
List Price:  E£3,803.52
You save:  E£1,902
ብር6,038.47
List Price:  ብር12,078.45
You save:  ብር6,039.98
Kz36,470
List Price:  Kz72,949.12
You save:  Kz36,479.12
CLP$37,975.70
List Price:  CLP$75,960.90
You save:  CLP$37,985.20
CN¥284.92
List Price:  CN¥569.92
You save:  CN¥285
RD$2,547.56
List Price:  RD$5,095.76
You save:  RD$2,548.20
DA5,206.89
List Price:  DA10,415.09
You save:  DA5,208.20
FJ$91.93
List Price:  FJ$183.88
You save:  FJ$91.95
Q306.63
List Price:  Q613.34
You save:  Q306.71
GY$8,375.76
List Price:  GY$16,753.62
You save:  GY$8,377.85
ISK kr4,894.77
List Price:  ISK kr9,790.77
You save:  ISK kr4,896
DH368.81
List Price:  DH737.71
You save:  DH368.90
L679.76
List Price:  L1,359.69
You save:  L679.93
ден2,126.49
List Price:  ден4,253.52
You save:  ден2,127.02
MOP$320.46
List Price:  MOP$641
You save:  MOP$320.54
N$693.29
List Price:  N$1,386.76
You save:  N$693.46
C$1,473.12
List Price:  C$2,946.62
You save:  C$1,473.49
रु5,632.10
List Price:  रु11,265.62
You save:  रु5,633.51
S/135.05
List Price:  S/270.14
You save:  S/135.08
K170.84
List Price:  K341.73
You save:  K170.89
SAR149.97
List Price:  SAR299.99
You save:  SAR150.01
ZK905.77
List Price:  ZK1,811.78
You save:  ZK906
L175.43
List Price:  L350.90
You save:  L175.47
Kč839.13
List Price:  Kč1,678.47
You save:  Kč839.34
Ft13,432.80
List Price:  Ft26,868.96
You save:  Ft13,436.16
SEK kr377.49
List Price:  SEK kr755.09
You save:  SEK kr377.59
ARS$58,276.64
List Price:  ARS$116,567.85
You save:  ARS$58,291.21
Bs276.63
List Price:  Bs553.33
You save:  Bs276.69
COP$155,770.71
List Price:  COP$311,580.38
You save:  COP$155,809.66
₡20,093.12
List Price:  ₡40,191.28
You save:  ₡20,098.15
L1,051.86
List Price:  L2,103.99
You save:  L1,052.12
₲283,589.36
List Price:  ₲567,249.64
You save:  ₲283,660.27
$U1,592.21
List Price:  $U3,184.83
You save:  $U1,592.61
zł146.09
List Price:  zł292.22
You save:  zł146.12
Already have an account? Log In

Transcript

Previously, we talked about the comparison operation. And if we want to check if two variables are equal, we would use triple equal signs. But the difference between using triple equal signs and double equal signs is that triple equal signs will check the type as well as the value of the two variables that you want to compare. But the double equal signs will only check the value regardless of the type. So for example, if I want now to compare w with z by using triple equal signs, if I save on run, I would get false despite w equals z, but the difference is that z is not of the same type as As w because z is a string is a string, and w is an integer. And this is the difference.

If you use triple equal signs, it will check the type as well as the value. But if you don't care about the type, if you just want to check the value, you would just use double equal signs. And now if I save and run, I would get through and as you can see, I get through because double equal signs doesn't care of the type of variable you are you are comparing, it just cares about the value itself. It doesn't care about the type of variable, but if you want to check the type as well, you should add triple equal signs. And of course, you can do the doesn't equal by using the exclamation. You just would replace the first equal sign with exclamation mark and if you want to To compare by using doesn't equal you, but you don't care about the type you just use doesn't equal with only a single equal mark.

So to recap, you only use the double equal signs when you want to compare the value itself and you don't care about the type of variables you are comparing. You would use triple equal signs when you want to compare the value as well as the tie

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.