JSPM

array-rearrange

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 412069
  • Score
    100M100P100Q179378F
  • License MIT

Rearrange array elements by index array

Package Exports

  • array-rearrange

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-rearrange) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

array-rearrange experimental Build Status

Reorder elements within array by index.

npm install array-rearrange

const reorder = require('array-rearrange')

let arr = reorder([9,8,7,6], [3,2,1,0]) // [6,7,8,9]

API

array = reorder(array, index)

Shuffle elements in array according to the index array passed. Faster than creating an auxiliary array. Based on the reference solution.

See also