While I browse for some JS Code, I found the code.
Sample code:
arg = "TEST ALERT MESSAGE";
MyFunction(arg);
function MyFunction()
{
alert(arg)
}
Above MyFunction() is given the alert message, but there is no parameter to receive the incoming arugment.
But when I change the 'arg' variable(in the function and out side the function 'arg'), it is not working.
How it is possible?
Thanks in advance
MyFunctiondoes not have a local version ofarg, it will try refer to a property namedargin the outer scope. Failing that you will getundefined.argumentspseudo array.