<head>
<script>
// Function With Arguments and no return type
function line(s, n) // called function
{
document.write("<br/>");
for(i=0; i<n; i++) {
document.write(s);
}
document.write("<br/>");
}
</script>
</head>
<body>
<script>
line('*', 80); // calling function
</script>
<h2>Welcome to JS</h2>
<script>
line('$', 50);
</script>
</body>
outpou:-
******************************************************
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
<script>
// Function With Arguments and no return type
function line(s, n) // called function
{
document.write("<br/>");
for(i=0; i<n; i++) {
document.write(s);
}
document.write("<br/>");
}
</script>
</head>
<body>
<script>
line('*', 80); // calling function
</script>
<h2>Welcome to JS</h2>
<script>
line('$', 50);
</script>
</body>
outpou:-
******************************************************
Welcome to JS
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
No comments:
Post a Comment