By giving console
to a array
, with one (1) object, and in lenght
of it, the expected return is obtained, then I update the array value, adding a new position, I give console in array
and return says that there are two objects in array
and then giving console
in lenght
of it is returned to me as if there was only one object.
Because the console does not return the correct array size when console
is given in length
, but returns the right amount when return is array
itself?
Context
This algorithm was to calculate the best distance between several points. The function itself (least_distance) should receive the routes, which is an object with routes that have not yet been defined, and the exclude, is an object with routes that should be removed from the new route because they have already been used. >
Update05/18/2018Iupdatedthecodewiththeintentionofsimplifyingitandfindingthisproblem,whichuntilthen,iswithoutsolution.
Project: link