<!DOCTYPE html>
<html>
<head>
<title>JavaScript Exercise</title>
<script type="text/javascript">
function handle_arguments(){
var number_of_arguments = arguments.length;
var list_of_arguments = "";
var msg;
var i;
for(i = 0; i < number_of_arguments; i++){
list_of_arguments += i + " : " + arguments[i] + "\n";
}
msg = "Number of arguments = " + number_of_arguments + "\n"
+ "List of arguments : \n" + list_of_arguments;
alert(msg);
}
function exercise(){
var j = "Javascript Exercise";
var not_init;
var its_null = null;
handle_arguments(1, "Hello", 3, j, not_init, its_null);
}
function htmlonload(){
exercise();
}
</script>
</head>
<body onload="htmlonload();">
JavaScript Exercise
</body>
</html>
Thursday, July 14, 2011
JavaScript Exercises - arguments to function
Labels:
JavaScript Exercises
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment