
array.findLast() – ES2022: Returns the **last element** that satisfies the testing function.
๐ Syntax
element = array.findLast(callbackFn[, thisArg]);
๐งช Example
const nums=[3,5,7,10,7];
console.log(nums.findLast(n => n < 8)); // 7
array.findLast() – ES2022: Returns the **last element** that satisfies the testing function.
element = array.findLast(callbackFn[, thisArg]);
const nums=[3,5,7,10,7];
console.log(nums.findLast(n => n < 8)); // 7
Comments
Post a Comment