Why is indexOf failing to find the object?

Arrays.asList(A) returns a List<int[]>. This is because it expects an array of objects, not primitive types. Your options include: use Integer[] instead of int[] inline the array, and let autoboxing take care of it; Arrays.asList(3,8,2,5,1,4,7,9) will work fine use Guava’s Ints.asList(int…) method to view the primitive array as a List<Integer>. (Disclosure: I contribute to Guava.) … Read more

Javascript 2d array indexOf

You cannot use indexOf to do complicated arrays (unless you serialize it making everything each coordinate into strings), you will need to use a for loop (or while) to search for that coordinate in that array assuming you know the format of the array (in this case it is 2d). var arr = [[2,3],[5,8],[1,1],[0,9],[5,7]]; var … Read more