I think I made the check explicit because from a readability point of view `submitform` is performing the bulk of the operation as oppose to some kind of predicate.

I'm not sure if this tristate pattern is common in JS but it is convenient (/lazy) for situations like this