Sha256: 6a3d4872356b651b03d296d09d3692b9116100da0b330302b0f812a47dcd54dc
Contents?: true
Size: 575 Bytes
Versions: 112
Compression:
Stored size: 575 Bytes
Contents
'use strict'; var GetIntrinsic = require('get-intrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var isNaN = require('../../helpers/isNaN'); var Type = require('../Type'); // https://262.ecma-international.org/11.0/#sec-numeric-types-number-sameValueZero module.exports = function NumberSameValueZero(x, y) { if (Type(x) !== 'Number' || Type(y) !== 'Number') { throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); } var xNaN = isNaN(x); var yNaN = isNaN(y); if (xNaN || yNaN) { return xNaN === yNaN; } return x === y; };
Version data entries
112 entries across 30 versions & 4 rubygems