What is the difference between = and == | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between = and ==

3rd May 2017, 2:15 AM
Ousmane Bah
Ousmane Bah - avatar
2 Answers
+ 7
In javascript you use a single = to declare a value of a variable. Double == is used to compare two values, do they equate to each other. Triple === is the same EXCEPT the two values must also be the same type of value, to equate true.
3rd May 2017, 2:21 AM
Damien Lucchese
Damien Lucchese - avatar
+ 4
= is the assing operator == is the comparision operator ( just in value, not in type)
3rd May 2017, 2:58 AM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar