///if the feature/method 'is' is not present on Object object
if (!Object.is) {
//define it
Object.is = function(x, y) {
//check wether they are equal without any conversion
if (x === y) {
//x not equal to zero
//or (example is(4,4) ) 1 / 4 (0.25) === 1 / 4 (0.25)
return x !== 0 || 1 / x === 1 / y;
} else {
// here is the big problem :(
// I know the below part deals with NaN, but what does it exactly mean?
return x !== x && y !== y;
}
};
}
source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is