Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 17, 2024
1 parent 147bbcc commit bea9b6d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import cartesianSquare = require( './../../../base/cartesian-square' );
import copy = require( './../../../base/copy' );
import copyIndexed = require( './../../../base/copy-indexed' );
import countFalsy = require( './../../../base/count-falsy' );
import countSameValue = require( './../../../base/count-same-value' );
import countSameValueZero = require( './../../../base/count-same-value-zero' );
import countTruthy = require( './../../../base/count-truthy' );
import dedupe = require( './../../../base/dedupe' );
import every = require( './../../../base/every' );
Expand Down Expand Up @@ -1340,6 +1342,47 @@ interface Namespace {
*/
countFalsy: typeof countFalsy;

/**
* Counts the number of elements in an array that are equal to a specified value.
*
* ## Notes
*
* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.
* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.
*
* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12
*
* @param x - input array
* @param value - search value
* @returns number of elements that are equal to a specified value
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countSameValue( x, 1 );
* // returns 3
*/
countSameValue: typeof countSameValue;

/**
* Counts the number of elements in an array that are equal to a specified value.
*
* ## Notes
*
* - In contrast to an implementation based on the strict equality operator `===`, the function treats `NaNs` as the same value.
*
* @param x - input array
* @param value - search value
* @returns number of elements that are equal to a specified value
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countSameValueZero( x, 1 );
* // returns 3
*/
countSameValueZero: typeof countSameValueZero;

/**
* Counts the number of truthy values in an array.
*
Expand Down

0 comments on commit bea9b6d

Please sign in to comment.