The order of instances in the return value of GetChildren()
is unspecified.
However, the order largely remains consistent, which can lead to subtle bugs when you assume that the order is consistent according to [some ordering].
While ROBLOX doesn’t guarantee the order of values, the actual order should be randomized so that these bugs aren’t so subtle.
This is something that the Go programming language has done with maps since almost the beginning; in order to dissuade programmers from depending on the order of iteration, the standard map object “randomizes” the order (I think in practice it only changes where iteration starts and perhaps the direction).