docs(bytes): update API doc of lastIndexOfNeedle (#4665)

This commit is contained in:
Yoshiya Hinosawa 2024-05-02 14:53:55 +09:00 committed by GitHub
parent 8c9e96c402
commit 1cfd39cf7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@
* @param source Source array to check.
* @param needle Needle array to check for.
* @param start Start index in the source array to begin the search. Defaults to
* the end of the array.
* `source.length - 1`.
* @returns Index of the last occurrence of the needle array in the source
* array, or -1 if it is not present.
*
@ -34,7 +34,7 @@
* const needle = new Uint8Array([1, 2]);
*
* lastIndexOfNeedle(source, needle, 2); // 1
* lastIndexOfNeedle(source, needle, 6); // 3
* lastIndexOfNeedle(source, needle, 6); // 5
* ```
* Defining a start index will begin the search at the specified index in the
* source array.