Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Great point! Array Data Structures aren't very efficient at arbitrarily inserting or plucking (even though JS provides convenient shift/deshift methods.)
With this small of a dataset it doesn't matter, but it's a great point. :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Probably that array is not going to be accessed using the index, it looks like an unordered collection.
If this is true you need a linked list not an array, making the move operation 2N more efficient and resulting in a simpler code.
Great point! Array Data Structures aren't very efficient at arbitrarily inserting or plucking (even though JS provides convenient shift/deshift methods.)
With this small of a dataset it doesn't matter, but it's a great point. :)