{"id":27944930,"url":"https://github.com/es-shims/array.prototype.findlastindex","last_synced_at":"2025-05-07T12:55:16.132Z","repository":{"id":57184243,"uuid":"385809192","full_name":"es-shims/Array.prototype.findLastIndex","owner":"es-shims","description":"An ESnext spec-compliant `Array.prototype.findLastIndex` shim/polyfill/replacement that works as far down as ES3.","archived":false,"fork":false,"pushed_at":"2025-03-14T18:20:00.000Z","size":130,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T12:55:06.030Z","etag":null,"topics":["array","ecmascript","findlastindex","javascript","polyfill","shim"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/es-shims.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/es5-shim","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-07-14T04:05:57.000Z","updated_at":"2025-03-14T18:20:03.000Z","dependencies_parsed_at":"2024-02-05T20:34:52.298Z","dependency_job_id":"f2d9324a-fb2f-4ab7-b47e-f4b88100541e","html_url":"https://github.com/es-shims/Array.prototype.findLastIndex","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"0cf914237811822d9d5268a057c0c9a108b8e5c0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FArray.prototype.findLastIndex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FArray.prototype.findLastIndex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FArray.prototype.findLastIndex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FArray.prototype.findLastIndex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/es-shims","download_url":"https://codeload.github.com/es-shims/Array.prototype.findLastIndex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252882793,"owners_count":21819155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","ecmascript","findlastindex","javascript","polyfill","shim"],"created_at":"2025-05-07T12:55:14.721Z","updated_at":"2025-05-07T12:55:16.126Z","avatar_url":"https://github.com/es-shims.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/es5-shim"],"categories":[],"sub_categories":[],"readme":"# array.prototype.findlastindex \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ESnext spec-compliant `Array.prototype.findLastIndex` shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.es/proposal-array-find-from-last).\n\nBecause `Array.prototype.findLastIndex` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.\n\n## Getting started\n\n```sh\nnpm install --save array.prototype.findlastindex\n```\n\n## Usage/Examples\n\n```js\nvar findLastIndex = require('array.prototype.findlastindex');\nvar assert = require('assert');\n\nvar arr = [1, [2], [], 3, [[4]]];\nvar isNumber = function (x) { return typeof x === 'number' };\n\nassert.deepEqual(findLastIndex(arr, isNumber), 3);\n```\n\n```js\nvar findLastIndex = require('array.prototype.findlastindex');\nvar assert = require('assert');\n/* when Array#findLastIndex is not present */\ndelete Array.prototype.findLastIndex;\nvar shimmed = findLastIndex.shim();\n\nassert.equal(shimmed, findLastIndex.getPolyfill());\nassert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));\n```\n\n```js\nvar findLastIndex = require('array.prototype.findlastindex');\nvar assert = require('assert');\n/* when Array#findLastIndex is present */\nvar shimmed = findLastIndex.shim();\n\nassert.equal(shimmed, Array.prototype.findLastIndex);\nassert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/array.prototype.findlastindex\n[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.findLastIndex.svg\n[deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLastIndex.svg\n[deps-url]: https://david-dm.org/es-shims/Array.prototype.findLastIndex\n[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLastIndex/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.findLastIndex#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/array.prototype.findlastindex.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/array.prototype.findlastindex.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/array.prototype.findlastindex.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.findlastindex\n[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.findLastIndex/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.findLastIndex/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.findLastIndex\n[actions-url]: https://github.com/es-shims/Array.prototype.findLastIndex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Farray.prototype.findlastindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fes-shims%2Farray.prototype.findlastindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Farray.prototype.findlastindex/lists"}