0

what is difference between = and==

18th Jul 2016, 11:21 AM
Binit
Binit - avatar
2 Answers
+ 1
Hi Binit, A double equals '==' is used solely for comparisons. For example: if (age == 18){} For pretty much everything else, such as declaring and modifying variables, a single equals '=' will do the trick just fine.
18th Jul 2016, 11:30 AM
Cohen Creber
Cohen Creber - avatar
0
for example: x=1; y=x; if (x==y){} while (x==y){}
18th Jul 2016, 11:30 AM
Apollo
Apollo - avatar