An open API service indexing awesome lists of open source software.

https://github.com/xotic750/same-value-x

Determines whether two values are the same value.
https://github.com/xotic750/same-value-x

browser is javascript nodejs object samevalue

Last synced: 12 months ago
JSON representation

Determines whether two values are the same value.

Awesome Lists containing this project

README

          


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**

```js
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
```