Reputation: 17785
In Javascript, you are supposed to be able to access the arguments passed to a function via the arguments key word. This should alert "tony" and "magoo" but instead it alerts "undefined" - why?
function myFunction(){
for(var i=0; i<arguments.length; i++){
alert(arguments[i].value);
}
}
myFunction("tony", "Magoo");
Upvotes: 0
Views: 406