How to change the position of an array element?

Spread the love

Question Description

I have a question on how I can change the index of a array element, so that it doesn’t come at the 7. position but at position 2 instead…

Is there a function to handle this?

Practice As Follows

Nothing is simpler:

array.insert(2, array.delete_at(7))

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.