Skip to content

arrMove JavaScriptDart

Moves the position of a specific element in an array to the specified position. (Position starts from 0.)

Parameters

  • array::any[]
  • from::number
  • to::number

Returns

any[]

Examples

javascript
arrMove([1, 2, 3, 4], 1, 0); // Returns [2, 1, 3, 4]

Released under the MIT License