bitwiseXOR.js 426 B

1234567891011121314
  1. 'use strict';
  2. var $TypeError = require('es-errors/type');
  3. var NumberBitwiseOp = require('../NumberBitwiseOp');
  4. // https://262.ecma-international.org/11.0/#sec-numeric-types-number-bitwiseXOR
  5. module.exports = function NumberBitwiseXOR(x, y) {
  6. if (typeof x !== 'number' || typeof y !== 'number') {
  7. throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
  8. }
  9. return NumberBitwiseOp('^', x, y);
  10. };