File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed
lib/node_modules/@stdlib/array/base/count-same-value Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ var out = countSameValue( x, 1 );
59
59
60
60
<section class =" notes " >
61
61
62
+ ## Notes
63
+
64
+ - The function uses the [ SameValue Algorithm] [ @stdlib/assert/is-same-value ] as specified in ECMAScript 5.
65
+
62
66
</section >
63
67
64
68
<!-- /.notes -->
@@ -108,6 +112,8 @@ console.log( n );
108
112
109
113
<section class =" links " >
110
114
115
+ [ @stdlib/assert/is-same-value ] : https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-value
116
+
111
117
</section >
112
118
113
119
<!-- /.links -->
Original file line number Diff line number Diff line change 3
3
Counts the number of elements in an array that are equal to a specified
4
4
value.
5
5
6
+ The function treats `-0` and `+0` as distinct and `NaNs` as the same.
7
+
6
8
Parameters
7
9
----------
8
10
x: ArrayLikeObject
Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ import { Collection } from '@stdlib/types/array';
25
25
/**
26
26
* Counts the number of elements in an array that are equal to a specified value.
27
27
*
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
+ *
28
35
* @param x - input array
29
36
* @param value - search value
30
37
* @returns number of elements that are equal to a specified value
Original file line number Diff line number Diff line change @@ -138,6 +138,13 @@ function complex( x, value ) {
138
138
/**
139
139
* Counts the number of elements in an array that are equal to a specified value.
140
140
*
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
+ *
141
148
* @param {Collection } x - input array
142
149
* @param {* } value - search value
143
150
* @returns {NonNegativeInteger } number of elements that are equal to a specified value
You can’t perform that action at this time.
0 commit comments