We would like to know how to pass an array in the parameters of a function.
<!--from w w w . j ava 2 s .co m-->
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
function someFunction(x){
for(i=0;i<x.length;i++) {
document.body.outerHTML += x[i];
}
}
someFunction(['one ', 'two ', 'three']);
</script>
</head>
<body>
</body>
</html>
The code above is rendered as follows: