Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

identical.js 1000B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. var isNaN = require("./is-nan");
  3. var isNegZero = require("./is-neg-zero");
  4. /**
  5. * Strict equality check according to EcmaScript Harmony's `egal`.
  6. *
  7. * **From the Harmony wiki:**
  8. * > An `egal` function simply makes available the internal `SameValue` function
  9. * > from section 9.12 of the ES5 spec. If two values are egal, then they are not
  10. * > observably distinguishable.
  11. *
  12. * `identical` returns `true` when `===` is `true`, except for `-0` and
  13. * `+0`, where it returns `false`. Additionally, it returns `true` when
  14. * `NaN` is compared to itself.
  15. *
  16. * @alias module:samsam.identical
  17. * @param {*} obj1 The first value to compare
  18. * @param {*} obj2 The second value to compare
  19. * @returns {boolean} Returns `true` when the objects are *egal*, `false` otherwise
  20. */
  21. function identical(obj1, obj2) {
  22. if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) {
  23. return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2);
  24. }
  25. return false;
  26. }
  27. module.exports = identical;