![]() |
A new method, TypedArray.prototype.findLast(), was introduced in ECMAScript 2023 (ES2023). The method findLast() of instances TypedArray proceeds traverse over the typed array backwards and provides method returning the value of the first element that satisfies the supplied testing function. When there are no elements fulfilling the function criterion then it returns an undefined. SyntaxfindLast(callbackFn) Parameter:
Return Type:The highest index in an array that matches a given testing function otherwise, it will return undefined if no match found. Example 1: In this example, we are finding last even number from an array.
Output: 12 Example 2: In this example we are finding the element greater than 10.
Output: 25 Supported Browsers
|
Reffered: https://www.geeksforgeeks.org
JavaScript |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |