Currently facing a roadblock with this particular issue. I am attempting to create a function that accepts an index as input and rearranges the element at that index in an array to be placed at the beginning, while keeping the order of the other elements accurate.
const unorderedArr = [item1, item2, item3, item4]
const reorderArr = (i, arr) => {
...
}
const reorderedArr = reorderArr(2, unorderedArr)
// [item3, item4, item1, item2]
Open to any hints!