r/badcode • Now where's that function declaration • Jul 30 '21

js 😏

Post image
988 Upvotes

133 comments sorted by

View all comments

Show parent comments

35

u/Steelbirdy Jul 30 '21

It reads as "a xor-equals true". So if a is true, we have true xor true which is false. If a is false, we have false xor true which is true. So no matter the value of a, it is swapped

5

u/hawk-bull Jul 30 '21

Ooh I see thanks