Agree (!scriptTypes) is better here. 
Btw, 'undefined == null' is true so it works correct