In Association with Amazon.in   Flipkart

Monday, September 30, 2013

JavaScript Function With Arguments and no Return Type

<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:-



******************************************************

Welcome to JS


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...