Gabe Wachob 🐵🐴👨💻👨🎤🐮<p>In today's <a href="https://sfba.social/tags/WTF" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>WTF</span></a> <a href="https://sfba.social/tags/Javascript" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Javascript</span></a>...</p><p>-0 and 0 both exist as legal number values because of IEEE 754, OK.</p><p>-0 == 0 because of IEEE 754, OK</p><p>-0 === 0 because OMG WTF Javascript?</p><p>I mean, its right there in <a href="https://262.ecma-international.org/6.0/#sec-strict-equality-comparison" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">262.ecma-international.org/6.0</span><span class="invisible">/#sec-strict-equality-comparison</span></a> but seriously, <a href="https://sfba.social/tags/OMGWTF" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OMGWTF</span></a> why?</p><p>I guess there's other operations that distinguish -0/0, but Javascript's various comparison operators are an endless fountain of confusion and bugs.</p><p><a href="https://sfba.social/tags/bugs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bugs</span></a> <a href="https://sfba.social/tags/software" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>software</span></a></p>