Test if a variable existsTag(s): Language
var foo = "bar"; if ( typeof( window[ 'foo' ] ) != "undefined" ) { document.write("foo is defined") } else { document.write("foo is undefined") }
And for fubar :
var foo = "bar"; if ( typeof( window[ 'foo' ] ) != "undefined" ) { document.write("foo is defined") } else { document.write("foo is undefined") }
And for fubar :