Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Add array move method #5745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

(feat) Add array move method #5745

wants to merge 1 commit into from

Conversation

buondevid
Copy link

This method modifies the array in place by moving one of its items to a new position.

Example:

const array = [1,2,3]
move(array, 0, 2)
console.log(array) // [2,3,1]

This function has been highly requested since 20161. While alternative packages2 have been created to fill the gap, including this function directly in Lodash would be beneficial for the Lodash user base.

Footnotes

  1. https://github.com/lodash/lodash/issues/1701

  2. https://www.npmjs.com/package/lodash-move

@buondevid buondevid changed the title (feat) Add array move method (feat) Add array move method Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants