I have a module created in JavaScript.
var test = function () {
var validate = function () {
alert("fg");
};
return {
validate: validate
};
}();
Now, can I access the above module using a string? For example:
$(function () {
var s = "test";
s.validate(); // error
});
Well, I tried, but no luck so far, because "s" is string. Is there any way to convert this string into above module object and access the validate method?
testfunction as global. Is it a global function or namespaced?