'' == ( '' || undefined )
This is not the same as
( '' == '' ) || ( '' == undefined )
This is more on the lines:
var foo = '' || undefined; // Results in undefined
And then comparing foowith an empty string:
foo == ''; // undefined == '' will result in false
Explanation
|| . , . JavaScript '' :
if ( '' ) console.log( 'Empty Strings are True?' );
undefined . , '' undefined , - , .