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

array example javascript

<html>
<head>
<title>Using Arrays</title>
</head>
<body>
<script language = "JavaScript" >
Arr1=new Array (5)
Arr1[0]=10
Arr1[1]=20
Arr1[2]=30
Arr1[3]=40
Arr1[4]=50
Arr2=new Array (11,12,13,14,15)
Arr3 = new Array (Arr1[0],Arr1[1],Arr1[2],Arr1[3],Arr1[4],Arr2)
sum=0
for(i=0;i<6;i++)
{
if(i==5)
{
for(j=0;j<5;j++)
{
sum+=Arr3[i][j]
}
}
else
{
sum+=Arr3[i]
}
}
document.write( "<B>"+"<U>"+"<CENTER>"+"The Contents of Array arr3"+"</center>"+"</U>"+"</B>")
document.write("<PRE>")
document.write("<BR>"+"Arr3 [0] \ t \ t= "+Arr3 [0] )
document.write("<BR>"+"Arr3 [1] \ t \ t= "+Arr3 [1] )
document.write("<BR>"+"Arr3 [2] \ t \ t= "+Arr3 [2] )
document.write("<BR>"+"Arr3 [3] \ t \ t= "+Arr3 [3] )
document.write("<BR>"+"Arr3[4] \ t \ t="+Arr3 [4] )
document.write("<BR>"+"Arr3[5][0] \t\t="+Arr3[5][0] )
document.write("<BR>"+"Arr3[5][1] \t\t="+Arr3[5][1] )
document.write("<BR>"+"Arr3[5][2] \t\t="+Arr3[5][2] )
document.write("<BR>"+"Arr3[5][3] \t\t="+Arr3[5][3] )
document.write("<BR>"+"Arr3[5][4] \t\t="+Arr3[5][4] )
document.write("<BR>"+" \t \t \t-")
document.write("<BR>"+"<B>"+"The Sum Is \t\t="+sum+"</B>"+"<BR>")
document.write("<BR>"+"\t\t\t")
document.write("<BR>"+"Length Of Arr1\t\t="+Arr1.length)
document.write("<BR>"+"Length Of Arr2\t\t="+Arr2.length)
document.write("<BR>"+"Length Of Arr3\t\t="+Arr3.length)
document.write("</PRE>")
</SCRIPT>
</hr>
</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