it is a bit weird that you call the method is_integer because you redefine what an integer is, so why not just call it isValidInteger() or similar. Also JS methods normally do not have _