You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StrictEqualityComparison.js 370B

1234567891011121314151617
  1. 'use strict';
  2. var Type = require('./Type');
  3. // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6
  4. module.exports = function StrictEqualityComparison(x, y) {
  5. var xType = Type(x);
  6. var yType = Type(y);
  7. if (xType !== yType) {
  8. return false;
  9. }
  10. if (xType === 'Undefined' || xType === 'Null') {
  11. return true;
  12. }
  13. return x === y; // shortcut for steps 4-7
  14. };