I cannot figure out why I keep getting -1 for lastProductIndex when clearly the lastProductID is in the array!
var lastProductID = 6758; var allProductIDs =
Try this instead:
$.grep(allProductIDs, function(n) { return n == lastProductID; });
Caveat: grep returns an array.
It looks like jQuery does an === instead of == with inArray.