I'm making a new object so that I can associate one of the properties to the object itself:
var byVert = {};
verticesClosest3.forEach(function (x){
byVert[x.vertix] = x;
});
The first object in byVert
corresponds to the first object of verticesClosest3
as one would expect.
But from the second object on only the vertex
property corresponds while other properties don't.
The problem probably lies in how I'm building the original-object, in the fiddle you can see that.
Maybe I understood the problem: there are a lot of vertices in verticesClosest3 that have the same vertix value; so simply the byVert shows all the same data that are in verticesClosest3 but in different order. Look at the image to see a couple of them.