mediawiki.api: use === undefined instead of typeof for local vars
Follows-up 7ce421f9bf.
typeof is analogous to isset() in PHP and tolerates non-existence,
and thus masks errors. The only reason to use typeof, is when
conditionally checking for the existence of a global variable, so
as to avoid a uncaught ReferenceError.
When referring to local vars or params, only its value needs to be
compared.
Ref https://www.mediawiki.org/wiki/CC/JS#Equality.
Bug: T359216
Change-Id: I509134993a41bb1bbcf829af8b56d72c85e10a92