would be nice if you could overload operators in JavaScript but you can't:
Can I define custom operator overloads in Javascript?
you can only hack the "==" operator which converts to strings before comparing:
http://blogger.xs4all.nl/peterned/archive/2009/04/01/462517.aspx