Claude Pache (2014-01-14T14:00:39.000Z)
domenic at domenicdenicola.com (2014-01-22T19:29:20.333Z)
Consider the following objects: url, url2, ... : URL objects location, location2, ... : Location objects a, a2, .... : HTMLAnchorElement objects All these objects implement URLUtils according to the WhatWG specs, and are therefore stringified using their `href` attribute. Now, which one of these equalities should "work" by just comparing the stringification? url == url2 location == url location == location2 a == url a == location a == a2 For me, I couldn't say. But in any case, my intention is clearer (and not too Java-esque) by writing the following: a.href == location.href In the worst case, when I don't know if I have a string or an URLUtils object, I just ensure that at least one member of the equality operator is stringified—and, most importantly, that it is evident from reading my code that one member is stringified: a.href == url String(whatever) == url