The object shouldn't care about order, it's simply a configuration object. If order is important, selectedModules should deal with that
The object is just for indexing.
If the user wishes to be able to re-order in the UI, selectedModules should be the array that's re-ordered.
If you re-order the array, it will "just work" because mapping is just iteration and is done in order (but you know this) 🙂