
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
array-find-last
Advanced tools
Add findLast and findLastIndex to Array.prototype. The findLastIndex() method returns the index of the last element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test. The findLa
Add findLast and findLastIndex to Array.prototype. The findLastIndex() method returns the index of the last element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test. The findLast() method returns the value of the last element in the provided array that satisfies the provided testing function. If no values satisfies the testing function, undefined is returned.
npm install array-find-last
# es6
import 'array-find-last';
require('array-find-last');
import 'array-find-last';
const array1 = [5, 12, 8, 130, 44];
const foundLast = array1.findLast(element => element > 10);
const foundLastIndex = array1.findLastIndex(element => element > 10);
console.log(foundLast);
// expected output: 44
console.log(foundLastIndex);
// expected output: 4
FAQs
Add findLast and findLastIndex to Array.prototype. The findLastIndex() method returns the index of the last element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test. The findLa
The npm package array-find-last receives a total of 665 weekly downloads. As such, array-find-last popularity was classified as not popular.
We found that array-find-last demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.