Forum Moderators: open
if(window.varName)
You'll want:
if(window['var_'+x])
For 100% safety (will return false if value is [0,'',false,undefined])
Use
if(typeof window['var_'+x]!= 'undefined')
..but an array will always evaluate true, so use the shorter version.