You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JavaScript Map and Set do not distinguish 0 and -0 as different keys, instead -0 is normalized to 0.
This leads to the following 'bug':
const{ Tuple }=require("tuplerone");if(Math.random()>0.5){Tuple(Object,-0);// sometimes create this first}else{Tuple(Object,0);// other times create this first}functionisNegativeZero(n){returnObject.is(n,-0);}console.log(isNegativeZero(Tuple(Object,-0)[1]));// sometimes 'true', sometimes 'false'
The text was updated successfully, but these errors were encountered:
In JavaScript
Map
andSet
do not distinguish0
and-0
as different keys, instead-0
is normalized to0
.This leads to the following 'bug':
The text was updated successfully, but these errors were encountered: