When I try to check for a function parameter if it is defined, and use
if (variablename === undefined) { do something };
sometimes it works as intendend, but sometimes(mainly very early on, when some scripts are possibly still loading) I get a javascript error, that states that
variablename is undefined
If I use
if (typeof variablename == 'undefined')
it works everytime.
Is the === undefined has some prerequisites, or what could be the problem?