source: node_modules/es-toolkit/dist/array/pullAt.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 307 bytes
Line 
1import { at } from './at.mjs';
2
3function pullAt(arr, indicesToRemove) {
4 const removed = at(arr, indicesToRemove);
5 const indices = new Set(indicesToRemove.slice().sort((x, y) => y - x));
6 for (const index of indices) {
7 arr.splice(index, 1);
8 }
9 return removed;
10}
11
12export { pullAt };
Note: See TracBrowser for help on using the repository browser.