Sha256: 26bf0a7b691fc9541b9d5c2e59ffb9e47480029ae5872b4463da733bd79ffc86

Contents?: true

Size: 556 Bytes

Versions: 112

Compression:

Stored size: 556 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-equal

module.exports = function NumberEqual(x, y) {
	if (Type(x) !== 'Number' || Type(y) !== 'Number') {
		throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
	}
	if (isNaN(x) || isNaN(y)) {
		return false;
	}
	// shortcut for the actual spec mechanics
	return x === y;
};

Version data entries

112 entries across 30 versions & 4 rubygems

Version Path
immosquare-cleaner-0.1.11 node_modules/es-abstract/2022/Number/equal.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2020/Number/equal.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2021/Number/equal.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2023/Number/equal.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2020/Number/equal.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2021/Number/equal.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2022/Number/equal.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2023/Number/equal.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2020/Number/equal.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2023/Number/equal.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2022/Number/equal.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2021/Number/equal.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2023/Number/equal.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2022/Number/equal.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2020/Number/equal.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2021/Number/equal.js
immosquare-cleaner-0.1.7 node_modules/es-abstract/2021/Number/equal.js
immosquare-cleaner-0.1.7 node_modules/es-abstract/2023/Number/equal.js
immosquare-cleaner-0.1.7 node_modules/es-abstract/2022/Number/equal.js
immosquare-cleaner-0.1.7 node_modules/es-abstract/2020/Number/equal.js