Frontend/25_01_07/mai/node_modules/es-abstract/2016/SameValue.js
szabomarton 7f4a15b9c3 asd
2025-01-28 11:38:27 +01:00

14 lines
312 B
JavaScript

'use strict';
var $isNaN = require('math-intrinsics/isNaN');
// http://262.ecma-international.org/5.1/#sec-9.12
module.exports = function SameValue(x, y) {
if (x === y) { // 0 === -0, but they are not identical.
if (x === 0) { return 1 / x === 1 / y; }
return true;
}
return $isNaN(x) && $isNaN(y);
};