Logical XOR in Javascript


/ Published in: JavaScript
Save to your folder(s)

There's no logical XOR in Javascript - no a ^^ b. Here's a workaround - note that null, undefined, '', 0 all count as 'false'


Copy this code and paste it in your HTML
  1. (!a != !b )

Report this snippet


Comments


You need to login to view comments.