due to a type error in a comparison this function is silently stepped over without failing
That is actually a language feature, javascript keeps running silently even if program it executes is complete garbage. Same for HTML, which silently ignores missing and wrong tags.