Raycasting: Two objects with the same distance

When the following statement is executed: " var intersects = raycaster.intersectObjects(scene.children,true);" and the intersects array has two objects that have the same distance. What’s the deciding factor that determines which object will become the first object in the array? Is simply the first one found occupies the first position?

The array with intersected objects is normally sorted by distance in ascending order. If the distance values are identical, the final order depends on which object are processed first in .intersectObjects().

Thanks for the quick response!

I have a quick question does the camera position (and angle) influence the order in which objects are placed in the intersects array?

No. The camera does not matter.

Ok. Thanks again for assistance.