3 ms·
To reduce the chance of creating an assignment expression when you intended a simple comparison. Yes, there's already a different operator for equality, but it'
by Zanni 8y ago
To reduce the chance of creating an assignment expression when you intended a simple comparison. Yes, there's already a different operator for equality, but it's easy to mistake = for ==. Forcing you to use := makes it a deliberate act, and makes your intention clear to the reader.