Skip to content

Commit e3eff9b

Browse files
committed
docs: add same value example
Ref: #1339 Ref: 634044b
1 parent e925974 commit e3eff9b

File tree

1 file changed

+9
-0
lines changed
  • lib/node_modules/@stdlib/array/base/count-same-value

1 file changed

+9
-0
lines changed

lib/node_modules/@stdlib/array/base/count-same-value/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ var out = countSameValue( x, 1 );
5151
// returns 2
5252
```
5353

54+
In contrast to an implementation using the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the same value.
55+
56+
```javascript
57+
var x = [ NaN, NaN, NaN ];
58+
59+
var out = countSameValue( x, NaN );
60+
// returns 3
61+
```
62+
5463
</section>
5564

5665
<!-- /.usage -->

0 commit comments

Comments
 (0)