There's the rub - the issue is that sometimes one or the other is a string and the other is an integer. So the strict equality of triple equals fails. The solution is either to use the double equal and allow for type coercion or explicitly convert to strings and compare.