same-value-x

2.1.1 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

same-value-x

Determines whether two values are the same value.

module.exports(value1, value2)boolean

This method is the comparison abstract operation SameValue(x, y), where x and y are ECMAScript language values, produces true or false.

Kind: Exported function
Returns: boolean - A Boolean indicating whether or not the two arguments are the same value.

Param Type Description
value1 * The first value to compare.
value2 * The second value to compare.

Example

import sameValue from 'same-value-x';
 
console.log(sameValue(1, 1)); // true
console.log(sameValue(true, true)); // true
console.log(sameValue(NaN, NaN)); // true
console.log(sameValue(true, false)); // false
console.log(sameValue(0, -0)); // false

Package Sidebar

Install

npm i same-value-x

Weekly Downloads

553

Version

2.1.1

License

MIT

Unpacked Size

34.5 kB

Total Files

11

Last publish

Collaborators

  • xotic750