You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
2835
2836
* @returns index
2836
2837
*
2837
2838
* @example
2838
2839
* var x = [ 1, 2, 3, 4 ];
2839
2840
*
2840
-
* var idx = ns.indexOf( x, 2, 0, false );
2841
+
* var idx = ns.indexOf( x, 2, 0 );
2841
2842
* // returns 1
2842
2843
*
2843
2844
* @example
2844
2845
* var Int32Array = require( '@stdlib/array/int32' );
2845
2846
*
2846
2847
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
2847
2848
*
2848
-
* var idx = ns.indexOf( x, 2, 0, false );
2849
+
* var idx = ns.indexOf( x, 2, 0 );
2849
2850
* // returns 1
2850
2851
*/
2851
2852
indexOf: typeofindexOf;
2852
2853
2854
+
/**
2855
+
* Returns the index of the first element which equals a provided search element according to the same value algorithm.
2856
+
*
2857
+
* ## Notes
2858
+
*
2859
+
* - If unable to find an element which equals a provided search element, the function returns `-1`.
2860
+
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
2861
+
*
2862
+
* @param x - input array
2863
+
* @param searchElement - search element
2864
+
* @param fromIndex - starting index (inclusive)
2865
+
* @returns index
2866
+
*
2867
+
* @example
2868
+
* var x = [ 1, 2, 3, 4 ];
2869
+
*
2870
+
* var idx = ns.indexOfSameValue( x, 2, 0 );
2871
+
* // returns 1
2872
+
*
2873
+
* @example
2874
+
* var Int32Array = require( '@stdlib/array/int32' );
2875
+
*
2876
+
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
2877
+
*
2878
+
* var idx = ns.indexOfSameValue( x, 2, 0 );
2879
+
* // returns 1
2880
+
*/
2881
+
indexOfSameValue: typeofindexOfSameValue;
2882
+
2853
2883
/**
2854
2884
* Returns the complement of a list of array indices.
2855
2885
*
@@ -2926,25 +2956,54 @@ interface Namespace {
2926
2956
* @param x - input array
2927
2957
* @param searchElement - search element
2928
2958
* @param fromIndex - starting index (inclusive)
2929
-
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
2930
2959
* @returns index
2931
2960
*
2932
2961
* @example
2933
2962
* var x = [ 1, 2, 3, 4 ];
2934
2963
*
2935
-
* var idx = ns.lastIndexOf( x, 2, 3, false );
2964
+
* var idx = ns.lastIndexOf( x, 2, 3 );
2936
2965
* // returns 1
2937
2966
*
2938
2967
* @example
2939
2968
* var Int32Array = require( '@stdlib/array/int32' );
2940
2969
*
2941
2970
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
2942
2971
*
2943
-
* var idx = ns.lastIndexOf( x, 2, 3, false );
2972
+
* var idx = ns.lastIndexOf( x, 2, 3 );
2944
2973
* // returns 1
2945
2974
*/
2946
2975
lastIndexOf: typeoflastIndexOf;
2947
2976
2977
+
/**
2978
+
* Returns the index of the last element which equals a provided search element according to the same value algorithm.
2979
+
*
2980
+
* ## Notes
2981
+
*
2982
+
* - The function scans an input array from the starting index to the beginning of the array (i.e., backward).
2983
+
* - If unable to find an element which equals a provided search element, the function returns `-1`.
2984
+
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
2985
+
*
2986
+
* @param x - input array
2987
+
* @param searchElement - search element
2988
+
* @param fromIndex - starting index (inclusive)
2989
+
* @returns index
2990
+
*
2991
+
* @example
2992
+
* var x = [ 1, 2, 3, 4 ];
2993
+
*
2994
+
* var idx = ns.lastIndexOfSameValue( x, 2, 3 );
2995
+
* // returns 1
2996
+
*
2997
+
* @example
2998
+
* var Int32Array = require( '@stdlib/array/int32' );
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/assert/docs/types/index.d.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -329,13 +329,13 @@ interface Namespace {
329
329
*
330
330
* ## Notes
331
331
*
332
-
* - When `val` is a string, the function checks whether the characters of the search string are found in the input string. The search is case-sensitive.
333
-
* - When `val` is an array-like object, the function checks whether the input array contains an element strictly equal to the specified search value.
332
+
* - When `value` is a string, the function checks whether the characters of the search string are found in the input string. The search is case-sensitive.
333
+
* - When `value` is an array-like object, the function checks whether the input array contains an element which is the same as the specified search value.
334
334
* - For strings, this function is modeled after `String.prototype.includes`, part of the ECMAScript 6 specification. This function is different from a call to `String.prototype.includes.call` insofar as type-checking is performed for all arguments.
335
-
* - The function does not distinguish between positive and negative zero.
335
+
* - The function does distinguish between positive and negative zero.
336
336
* - If `position < 0`, the search is performed for the entire input array or string.
337
337
*
338
-
* @paramval - input value
338
+
* @paramvalue - input value
339
339
* @param searchValue - search value
340
340
* @param position - position at which to start searching for `searchValue` (default: 0)
341
341
* @throws second argument must be a primitive string primitive when the first argument is a string
0 commit comments