Why do we use double equals (==) for comparison?

Asked by emeka_nwankwo · 4 months ago

1 Answer

48
amorebise · 4 months ago Top Answer

This is a common trap for beginners! A single '=' is for Assigning a value (like putting stuff in a box). A double '==' is for Comparing two things (like checking if two boxes have the same stuff).

Think of it as the difference between making something true and checking if it is true. It's a small detail that saves you from big bugs!

Log in to add a comment.