is.js 289 B

12345678910
  1. // Implementation credits go to:
  2. // http://wiki.ecmascript.org/doku.php?id=harmony:egal
  3. "use strict";
  4. var numIsNaN = require("../number/is-nan");
  5. module.exports = function (val1, val2) {
  6. return val1 === val2 ? val1 !== 0 || 1 / val1 === 1 / val2 : numIsNaN(val1) && numIsNaN(val2);
  7. };