Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

lodash-move

granteagon53.2kMIT1.1.1

Move an item in an array (proposed lodash feature #1701)

readme

_.move LoDash mixin

Move an item in an array

npm install lodash-move

LoDash issue is here. Give it a 👍 if you want to see it added to Lodash.

Example

move(['a', 'b', 'c'], 2, 0)
// -> ['c', 'a', 'b']

move([{name: 'Fred'}, {name: 'Barney'}, {name: 'Wilma'}, {name: 'Betty'}], 2, 1)
// -> [{name: 'Fred', name: 'Wilman', name: 'Barney', name: 'Betty'}]