Skip to content

Commit e925974

Browse files
committed
docs: add notes concerning algorithm
Ref: #1339 Ref: 634044b
1 parent 9d7da34 commit e925974

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ var out = countSameValue( x, 1 );
5959

6060
<section class="notes">
6161

62+
## Notes
63+
64+
- The function uses the [SameValue Algorithm][@stdlib/assert/is-same-value] as specified in ECMAScript 5.
65+
6266
</section>
6367

6468
<!-- /.notes -->
@@ -108,6 +112,8 @@ console.log( n );
108112

109113
<section class="links">
110114

115+
[@stdlib/assert/is-same-value]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-value
116+
111117
</section>
112118

113119
<!-- /.links -->

lib/node_modules/@stdlib/array/base/count-same-value/docs/repl.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Counts the number of elements in an array that are equal to a specified
44
value.
55

6+
The function treats `-0` and `+0` as distinct and `NaNs` as the same.
7+
68
Parameters
79
----------
810
x: ArrayLikeObject

lib/node_modules/@stdlib/array/base/count-same-value/docs/types/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ import { Collection } from '@stdlib/types/array';
2525
/**
2626
* Counts the number of elements in an array that are equal to a specified value.
2727
*
28+
* ## Notes
29+
*
30+
* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.
31+
* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.
32+
*
33+
* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12
34+
*
2835
* @param x - input array
2936
* @param value - search value
3037
* @returns number of elements that are equal to a specified value

lib/node_modules/@stdlib/array/base/count-same-value/lib/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ function complex( x, value ) {
138138
/**
139139
* Counts the number of elements in an array that are equal to a specified value.
140140
*
141+
* ## Notes
142+
*
143+
* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.
144+
* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.
145+
*
146+
* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12
147+
*
141148
* @param {Collection} x - input array
142149
* @param {*} value - search value
143150
* @returns {NonNegativeInteger} number of elements that are equal to a specified value

0 commit comments

Comments
 (0)