* Mutate an array, moving a set of elements into a new index position * * @param arr Array to modify * @param from Start move index * @param count Number of elements to move * @param to Index where the start element will move to
(arr, from, count, to)
| 17146 | * @param to Index where the start element will move to |
| 17147 | */ |
| 17148 | function arrayMove(arr, from, count, to) { |
| 17149 | var movers = arr.splice(from, count) |
| 17150 | // Add delete and start to the array, so we can use it for the `apply` |
| 17151 | movers.unshift(0) // splice delete param |
| 17152 | movers.unshift(to < from ? to : to - count + 1) // splice start param |
| 17153 | arr.splice.apply(arr, movers) |
| 17154 | } |
| 17155 | /** |
| 17156 | * Run finishing activities after one or more columns have been reordered. |
| 17157 | * |
no outgoing calls
no test coverage detected