Code: Select all
<script type = "text/javascript">
function sum(){
for(j=1; j<5; j++){
x=0; //Initialize the horizontal displacement
x += j;
return x;
}
}//Function end
alert(sum());
</script>
Moderator: General Moderators
Code: Select all
<script type = "text/javascript">
function sum(){
for(j=1; j<5; j++){
x=0; //Initialize the horizontal displacement
x += j;
return x;
}
}//Function end
alert(sum());
</script>