implementation.js 286 B

12345678910111213141516171819
  1. 'use strict';
  2. var numberIsNaN = function (value) {
  3. return value !== value;
  4. };
  5. module.exports = function is(a, b) {
  6. if (a === 0 && b === 0) {
  7. return 1 / a === 1 / b;
  8. }
  9. if (a === b) {
  10. return true;
  11. }
  12. if (numberIsNaN(a) && numberIsNaN(b)) {
  13. return true;
  14. }
  15. return false;
  16. };