PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/node_modules/lodash/eq.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 37 lines | 4 code | 1 blank | 32 comment | 2 complexity | a645e467afa2982d5b46a98c99a31182 MD5 | raw file
 1/**
 2 * Performs a
 3 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 4 * comparison between two values to determine if they are equivalent.
 5 *
 6 * @static
 7 * @memberOf _
 8 * @since 4.0.0
 9 * @category Lang
10 * @param {*} value The value to compare.
11 * @param {*} other The other value to compare.
12 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
13 * @example
14 *
15 * var object = { 'a': 1 };
16 * var other = { 'a': 1 };
17 *
18 * _.eq(object, object);
19 * // => true
20 *
21 * _.eq(object, other);
22 * // => false
23 *
24 * _.eq('a', 'a');
25 * // => true
26 *
27 * _.eq('a', Object('a'));
28 * // => false
29 *
30 * _.eq(NaN, NaN);
31 * // => true
32 */
33function eq(value, other) {
34  return value === other || (value !== value && other !== other);
35}
36
37module.exports = eq;