1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Java Script Tutorials

argument functions example javascript

<HTML>
<HEAD>
<TITLE> Sum Function </TITLE>
<SCRIPT LANGUAGE = "JavaScript">
//Should not overload these type of var argument functions
function Sum(num1, num2)
{
    var ans = num1 + num2
    document.write("<br>");
    document.write ("The Sum in Seperate sum function Is " + ans)    
}

function Sum ()
{

    var len = Sum.arguments.length
    var ans = 0
    for (i=0; i<len; i++)    
    {
        ans += Sum.arguments[i]    
    }
    document.write("<br>");
    document.write("\nThe Sum for variable args Is" + ans)
}


</SCRIPT>
</HEAD>
<BODY>
<H1 ALIGN = "CENTER"> Function To Add the Numbers</H1>
<SCRIPT LANGUAGE = "JavaScript">
Sum (1,2);
Sum (10,20,30)
Sum (10,2,30,40)
Sum()
</SCRIPT>
<BODY>
</HTML>

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy