what's the difference btw = and ==? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what's the difference btw = and ==?

12th Jun 2016, 5:50 PM
Peters Chikezie
Peters Chikezie - avatar
3 Answers
+ 3
'=' operator is for assigning values a=2; // a now has a value equal to 2 "==" operator is for checking equality a==2; // checking if a has a value equal to 2 "==" is a condition and cannot be used independently anywhere. It must have a function assoiciated with it
12th Jun 2016, 6:06 PM
Satan 666
Satan 666 - avatar
+ 1
thank you.
12th Jun 2016, 6:16 PM
Peters Chikezie
Peters Chikezie - avatar
+ 1
or in simple = is called equal and == is called test for equality.
12th Jun 2016, 7:17 PM
CHURCHIL
CHURCHIL - avatar