How can I check if a dynamically named object or function exists?
In example:
var str = \'test\';
var obj_str = \'Page_\'+str;
function Pag
if you run your code in browser, just access global object by window, your code may like this:
if (typeof window[obj_str] === 'string') {
alert('ok');
}
otherwise, you should gain access to global object:
var global = function() { return this; }() || (1,eval)('this');
if (typeof global[obj_str] === 'stribg